-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(material/autocomplete): don't reset active option if list of options changes #16616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(material/autocomplete): don't reset active option if list of options changes #16616
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
2fd76ac
to
f9294f0
Compare
Presubmit failures - Looks like some tests rely on the fact that they can insert options after the panel is opened and expect the first item to be active. This is not the case now that option changes do not activate the first item |
…ons changes Currently we reset the active option whenever the list of items changes, however this means that the user's selection could be lost while they're interacting, if some items get added to the end of the list out of view (e.g. if the options are fetched via polling). These changes address the issue by only resetting the active option when the panel is opened. Fixes angular#16608.
f9294f0
to
01209a2
Compare
I've rebased this and come up with a different approach to try and minimize presubmit issues. Will run another presubmit to verify. |
The alternate approach broke a bunch of clients, because the first option no longer gets activated after the user filters the list. |
Currently we reset the active option whenever the list of items changes, however this means that the user's selection could be lost while they're interacting, if some items get added to the end of the list out of view (e.g. if the options are fetched via polling).
These changes address the issue by only resetting the active option when the panel is opened.
Fixes #16608.