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.

@oobie11
Copy link

oobie11 commented Sep 5, 2024

Having this issue too in Safari. data-action="keydown.esc->modal#close" is triggered when selecting an autocomplete option.

@abrieff
Copy link

abrieff commented Nov 7, 2024

What is the status of this?

@Tonksthebear
Copy link

Also curious as I just ran into it as well.

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.

6 participants