Gbuomprisco / ngx-chips

Tag Input component for Angular
MIT License
899 stars 359 forks source link

Swallows keydown event if used with ng9 ngZoneEventCoalescing #968

Closed szabyg closed 3 years ago

szabyg commented 3 years ago

PLEASE MAKE SURE THAT:

I'm submitting a ... (check one with "x")

[ x ] bug report => search github for a similar issue or PR before submitting
[ ] support request/question

Current behavior If the component is used with angular 9 and with ngZoneEventCoalescing being turned on, some keydown events get lost if the user types fast.

Minimal reproduction of the problem with instructions (if applicable) Turn on ngZoneEventCoalescing in main.ts of the app.

Demo: https://eurofunk.github.io/ngx-chips/dist/ There is an easy way to reproduce with keydown and keyup events overlapping:

  1. Select two keys e.g. d and f and put your fingers on them
  2. Keydown d
  3. Keydown and Keyup f
  4. Keyup d

You have to do this at least so fast that the browser doesn't start repeating d. What you see is only "d" in the input field. Expected behavior

Both letters, "df", should be in the input field.

What do you use to build your app?. Please specify the version

Angular version: 9.1.12

ngx-chips version: 2.1.0

Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

Chrome 85 Firefox Edge 85

Gbuomprisco commented 3 years ago

Thank you for the PR @szabyg! The branch needs to be updated :)

szabyg commented 3 years ago

I rebased it just now.

szabyg commented 3 years ago

@Gbuomprisco Thanks for merging. Can you please release the bugfix as well?

Gbuomprisco commented 3 years ago

just released :)