-
Notifications
You must be signed in to change notification settings - Fork 426
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
Email autocomplete on <input>
triggers keydown.esc
data-action event
#743
Comments
In Safari, the event emitted is of type Lines 89 to 91 in 349dc16
|
I couldn't get Chrome to autocomplete emails so I couldn't test the type of Events it emits in this situation. |
Hi, @marcoroth, |
I have a similar issue on Chrome when: <dialog
data-dialog-target="dialog"
data-action="keydown.meta+k@window->dialog#open keydown.ctrl+k@window->dialog#open"
>
<twig:SearchSite/>
</dialog> And when the username and/or password fields are automatically filled in, a keydown event is triggered. |
If you setup a
data-action
with akeydown.esc
event it will trigger the action whenever you autocomplete the<input>
with a selection from the browser popup:Here's a codepen to demonstrate the behaviour:
https://codepen.io/marcoroth/pen/vYbPNeE?editors=1010
It looks like it's not only specific to the
esc
modifier, as it also happens for any other modifier or the plainkeydown
event as well. It seems like the autocomplete in browsers is being simulated by emitting a series ofkeydown
,keyup
andchange
events to mimic user input.Maybe we can detect if an event wasn't actual human input and then prevent the action from being run.
/cc @tylerklose
The text was updated successfully, but these errors were encountered: