Description
Bug, feature request, or proposal:
When tabbing into (not clicking!) an autocomplete with autoActiveFirstOption
enabled and floatLabel
disabled on the form field, the first option does not become active.
It will become active if you press another key after tabbing in, inspecting the element or any other action that cause an event for the zone.
When adding this._changeDetectorRef.detectChanges();
in autocomplete-trigger.ts
at line 500
, it works (src/lib/autocomplete/autocomplete-trigger.ts:500).
My guess is that at this point the zone is stable and all the changes done (setting the active option, ...) are not picked up for the CD.
When enabling floatLabel
, it works as expected. So it seems that the floatLabel triggers another CD after that, and the changes will get recognized.
What is the expected behavior?
First option should be active.
What is the current behavior?
First option is not active.
What are the steps to reproduce?
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Current versions.
Forked the existing material autocomplete autoActiveFirstOption stackblitz example.