Skip to content

bug(Autocomplete): (optionActivated) not triggered when [autoActiveFirstOption] and option list changes #19661

@zakhenry

Description

@zakhenry

Reproduction

https://stackblitz.com/angular/vkkedkvndlkq

Steps to reproduce:

  1. Open console
  2. Click autocomplete field - see in console One is output ✅
  3. Type "three" - see no option is output in console ❌
  4. Type {backpace} 4x until just T remains
  5. See that Two is output in the console ✅

Expected Behavior

When autoActiveFirstOption input is set, every time the list of options updates the (optionActivated) eventemitter should emit the first value in the list of options (if it changes).

Actual Behavior

When causing less values to be in the list, no events emitted, but when more items appear in the list (backspacing the search) the items were emitted.

Environment

  • Angular: ^9.0.0
  • CDK/Material: ^9.0.0
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Mac

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/a11y

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions