Skip to content
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

bug(MatAutoComplete): optionActivated is invoked with the first item when ESC is pressed #23430

Closed
conner-fallone opened this issue Aug 23, 2021 · 1 comment · Fixed by #23437
Assignees
Labels
area: material/autocomplete P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@conner-fallone
Copy link

Reproduction

https://stackblitz.com/edit/angular-nfavep?file=src%2Fapp%2Fautocomplete-auto-active-first-option-example.html

Steps to reproduce:

  1. Click in the auto complete to toggle the dropdown
  2. Arrow down to item "Two" or "Three"
  3. Press the ESC key and notice that optionActivated fires for item "One" (see log statements)

Expected Behavior

The optionActivated option should not be invoked when the ESC key is pressed to close the auto complete

Actual Behavior

The optionActivated option is invoked when it shouldn't be since the the auto complete is closing

Environment

  • Angular: 11
  • CDK/Material: 11
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows
@conner-fallone conner-fallone added the needs triage This issue needs to be triaged by the team label Aug 23, 2021
@crisbeto crisbeto self-assigned this Aug 24, 2021
@crisbeto crisbeto added area: material/autocomplete has pr P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed needs triage This issue needs to be triaged by the team labels Aug 24, 2021
crisbeto added a commit to crisbeto/material2 that referenced this issue Aug 24, 2021
…ion is reset

Fixes that we were emitting the `optionActivated` event when the option is reset programmatically when the panel closes. The intent was to only emit the event as a result of a user action.

Fixes angular#23430.
zarend pushed a commit that referenced this issue Sep 7, 2021
…ion is reset (#23437)

Fixes that we were emitting the `optionActivated` event when the option is reset programmatically when the panel closes. The intent was to only emit the event as a result of a user action.

Fixes #23430.
zarend pushed a commit that referenced this issue Sep 7, 2021
…ion is reset (#23437)

Fixes that we were emitting the `optionActivated` event when the option is reset programmatically when the panel closes. The intent was to only emit the event as a result of a user action.

Fixes #23430.

(cherry picked from commit 9a4a4cf)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/autocomplete P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants