mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Templating: highlight first item when searching a variable dropdown (#20264)
This commit is contained in:
parent
85c4311c9f
commit
ba7049dd0f
@ -279,7 +279,7 @@ export class ValueSelectDropdownCtrl {
|
||||
}
|
||||
|
||||
updateUIBoundOptions($scope: IScope, options: any[]) {
|
||||
this.highlightIndex = -1;
|
||||
this.highlightIndex = 0;
|
||||
this.search.options = options.slice(0, Math.min(options.length, 1000));
|
||||
$scope.$apply();
|
||||
}
|
||||
|
@ -253,8 +253,8 @@ describe('updateUIBoundOptions', () => {
|
||||
ctrl.updateUIBoundOptions($scope, options);
|
||||
});
|
||||
|
||||
it('then highlightIndex should be reset', () => {
|
||||
expect(ctrl.highlightIndex).toEqual(-1);
|
||||
it('then highlightIndex should be reset to first item', () => {
|
||||
expect(ctrl.highlightIndex).toEqual(0);
|
||||
});
|
||||
|
||||
it('then search.options should be same as options but capped to 1000', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user