Skip to content

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

Closed
@labeled

Description

@labeled

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

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions