This repository was archived by the owner on Sep 5, 2024. It is now read-only.
fix(autocomplete): suggestions can be highlighted incorrectly #11529
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
Please check that your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The second time and beyond when a chips autocomplete dropdown panel is opened, there will be a background on some of the matches to indicate that they are selected, even when they are not selected. It's very confusing UX.
Using
ng-class
withinmd-virtual-repeat
doesn't seem to be workingit was evaluating the following to
true
:-1 === 0
,-1 === 1
, etc.Issue Number:
Fixes #10573.
What is the new behavior?
We no longer depend on
ng-class
here and use the#selected_option
selector for styling.This results in no bogus suggestions being highlighted as selected and only the hovered or selected items being highlighted.
Does this PR introduce a breaking change?
Other information
This could cause some issues for apps who are relying on the
md-virtual-repeat li.selected
class for styling their app. However, this is unlikely as this bug would have made styling based on that class unreliable.