Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 320511c

Browse files
Splaktarmmalerba
authored andcommitted
fix(autocomplete): suggestions can be highlighted incorrectly (#11529)
using ng-class within md-virtual-repeat doesn't seem to be working it was evaluating the following to true: -1 === 0, -1 === 1, etc. Fixes #10573.
1 parent 8a4105c commit 320511c

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/components/autocomplete/autocomplete-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ md-autocomplete.md-THEME_NAME-theme {
5151
li {
5252
color: '{{foreground-1}}';
5353
&:hover,
54-
&.selected {
54+
&#selected_option {
5555
background: '{{background-500-0.18}}';
5656
}
5757
}

src/components/autocomplete/js/autocompleteDirective.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ function MdAutocomplete ($$mdSvgRegistry) {
368368
id="ul-{{$mdAutocompleteCtrl.id}}"\
369369
role="listbox">\
370370
<li md-virtual-repeat="item in $mdAutocompleteCtrl.matches"\
371-
ng-class="{ selected: $index === $mdAutocompleteCtrl.index }"\
372371
ng-attr-id="{{$index === $mdAutocompleteCtrl.index ? \'selected_option\' : undefined}}"\
373372
ng-click="$mdAutocompleteCtrl.select($index)"\
374373
role="option"\

0 commit comments

Comments
 (0)