Skip to content

Commit 604f8a2

Browse files
committed
Fixed state issue with variable value dropdown, grafana#2080
1 parent f6845cd commit 604f8a2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

public/app/directives/valueSelectDropdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function (angular, app, _) {
3434
var tag = { text: value, selected: false };
3535
_.each(vm.variable.current.tags, function(tagObj) {
3636
if (tagObj.text === value) {
37-
tag.selected = true;
37+
tag = tagObj;
3838
}
3939
});
4040
return tag;

public/test/specs/valueSelectDropdown-specs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function () {
138138
describe("Given variable with selected tags", function() {
139139
beforeEach(function() {
140140
ctrl.variable = {
141-
current: {text: 'server-1', value: 'server-1', tags: [{text: 'key1'}] },
141+
current: {text: 'server-1', value: 'server-1', tags: [{text: 'key1', selected: true}] },
142142
options: [
143143
{text: 'server-1', value: 'server-1'},
144144
{text: 'server-2', value: 'server-2'},

0 commit comments

Comments
 (0)