Skip to content

Autocomplete: expose option activated event #17587

@ahnpnl

Description

@ahnpnl

Feature Description

At the moment, mat-autocomplete only exposes optionSelected event which is fired when users choose an option in the autocomplete list. However, if users want to listen to option activated, there is no public API for that.

Option activated means users go through the list of options in autocomplete list by keyboard event. At this point, mat-option is marked as active. I've checked mat-option APIs but there is no public API for that either.

Use Case

I have a use case that I have an autocomplete input field which performs live search for data. This autocomplete field is similar to google search input field. When users go through the list of autocomplete options by arrow down/arrow up, the activated option is displayed on the input field. By listening to option activated event, I can display the activated option in the input field

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions