components icon indicating copy to clipboard operation
components copied to clipboard

fix(material/autocomplete): don't reset active option if list of options changes

Open crisbeto opened this issue 6 years ago • 3 comments

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.

crisbeto avatar Jul 26 '19 16:07 crisbeto

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

andrewseguin avatar Aug 21 '19 19:08 andrewseguin

I've rebased this and come up with a different approach to try and minimize presubmit issues. Will run another presubmit to verify.

crisbeto avatar Mar 13 '22 11:03 crisbeto

The alternate approach broke a bunch of clients, because the first option no longer gets activated after the user filters the list.

crisbeto avatar Mar 14 '22 09:03 crisbeto