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(matChipInputTokenEnd): Holding Enter Causes many matChipInputTokenEnd events #29883

Closed
1 task
labeled opened this issue Oct 16, 2024 · 1 comment · Fixed by #29894
Closed
1 task

bug(matChipInputTokenEnd): Holding Enter Causes many matChipInputTokenEnd events #29883

labeled opened this issue Oct 16, 2024 · 1 comment · Fixed by #29894
Assignees
Labels
area: material/chips P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@labeled
Copy link

labeled commented Oct 16, 2024

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

I'm unsure if this is working as intended or if there is a working way to prevent this. If you go to one of your examples in stack blitz https://stackblitz.com/run?file=src%2Fapp%2Fchips-autocomplete-example.ts and add a console log to the add method and then hold down the enter key in the chip input, you'll see the event fire until you let go of the key.

I would expect it to use something like keyup to wait until the key has been released or prevent it from firing so much if a key is stuck or held for longer than a few ms.

Reproduction

StackBlitz link:
Steps to reproduce:

  1. Hold Enter Key in chip input

Expected Behavior

Only one event happens after key is released

Actual Behavior

Infinite events fire as key is held

Environment

  • Angular: 18
  • CDK/Material: 18
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows
@labeled labeled added the needs triage This issue needs to be triaged by the team label Oct 16, 2024
@crisbeto crisbeto self-assigned this Oct 18, 2024
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: material/chips and removed needs triage This issue needs to be triaged by the team labels Oct 18, 2024
crisbeto added a commit to crisbeto/material2 that referenced this issue Oct 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…own key

Fixes that that the chip input was emitting the `matChipEnd` event while the user is holding down the separator key.

Fixes angular#29883.
crisbeto added a commit that referenced this issue Oct 18, 2024
…own key (#29894)

Fixes that that the chip input was emitting the `matChipEnd` event while the user is holding down the separator key.

Fixes #29883.
crisbeto added a commit that referenced this issue Oct 18, 2024
…own key (#29894)

Fixes that that the chip input was emitting the `matChipEnd` event while the user is holding down the separator key.

Fixes #29883.

(cherry picked from commit 5153a5c)
@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 Nov 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/chips 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