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

Add support for key events with autocomplete in Chrome #713

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tsmd
Copy link

@tsmd tsmd commented Aug 13, 2023

In Google Chrome, when a text field has focus and an input suggestion is confirmed, a keydown event is fired. However, the event interface is not a KeyboardEvent, which causes the event handler to fail to determine whether it should be called. This change adds a test to ensure that the event handler is called correctly in this scenario.

I have created a minimal reproduction script; please setup Google Chrome to autocomplete the email address and select the candidate that appears. You will see that all event handlers are executed regardless of the key type.
https://codepen.io/tsmd/pen/rNQgoWg?editors=1010

In Google Chrome, when a text field has focus and an input suggestion is confirmed, a `keydown` event is fired. However, the event interface is not a `KeyboardEvent`, which causes the event handler to fail to determine whether it should be called. This change adds a test to ensure that the event handler is called correctly in this scenario.
@drewblas
Copy link

We are affected by this as well and it causes our keydown triggers to trigger from the chrome autocomplete selections

@oliverguenther
Copy link

We're affected by this as well, selecting an autocomplete item with e.g., a keydown#esc-> event causes it to be called despite the key not being pressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants