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

fix(autocomplete): suggestions can be highlighted incorrectly #11529

Merged
merged 1 commit into from
Jan 5, 2019

Conversation

Splaktar
Copy link
Contributor

@Splaktar Splaktar commented Nov 29, 2018

PR Checklist

Please check that your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added or this is not a bug fix / enhancement
  • Docs have been added, updated, or were not required

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Enhancement
[ ] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:

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 within md-virtual-repeat doesn't seem to be working
it 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?

[ ] Yes
[x] No

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.

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.
@Splaktar Splaktar added type: bug a11y This issue is related to accessibility P3: important Important issues that really should be fixed when possible. labels Nov 29, 2018
@Splaktar Splaktar added this to the 1.1.12 milestone Nov 29, 2018
@Splaktar Splaktar self-assigned this Nov 29, 2018
@googlebot googlebot added the cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ label Nov 29, 2018
@Splaktar Splaktar added the pr: merge ready This PR is ready for a caretaker to review label Nov 29, 2018
@Splaktar Splaktar mentioned this pull request Nov 29, 2018
3 tasks
@Splaktar Splaktar assigned jelbourn and mmalerba and unassigned jelbourn Dec 20, 2018
@Splaktar Splaktar modified the milestones: 1.1.12, 1.1.13 Jan 3, 2019
@mmalerba mmalerba merged commit 320511c into master Jan 5, 2019
@Splaktar Splaktar deleted the autocomplete-wrongSuggestionsHighlighted branch January 6, 2019 05:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a11y This issue is related to accessibility cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ P3: important Important issues that really should be fixed when possible. pr: merge ready This PR is ready for a caretaker to review type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

autocomplete(chips): popup selection list has an invalid default selection when opened the second time
4 participants