You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying to figure out what spec text to propose for the textInput event (#353) I found that the spec doesn't seem to match implementations for the default action for the keydown, composition*, beforeinput, textInput, input events, and whether/when they're cancelable.
If the key is associated with a character, the default action MUST be to dispatch a beforeinput event followed by an input event.
However, in Chrome, Safari and Firefox, if you cancel a beforeinput event, no input event is fired.
Chrome and Safari support textInput, and if you cancel that event, no input event is fired.
So, assuming the correct event order for typing a single non-composing character in a text field is:
keydown
keypress
beforeinput
textInput
input
keyup
...the default actions should be:
event
default action
keydown
fire keypress
keypress
fire beforeinput
beforeinput
fire textInput
textInput
update DOM; fire input
input
none
keyup
none
During composition I think beforeinput isn't cancelable as implemented (try typing ¨ in the demo), and keypress isn't fired.
The spec also says that compositionupdate and compositionend are not cancelable, but in Chrome and Safari they are. In Firefox they are not cancelable, and compositionstart is also not cancelable.
The text was updated successfully, but these errors were encountered:
While trying to figure out what spec text to propose for the
textInput
event (#353) I found that the spec doesn't seem to match implementations for the default action for the keydown, composition*, beforeinput, textInput, input events, and whether/when they're cancelable.Demo: https://software.hixie.ch/utilities/js/live-dom-viewer/saved/12161
For example, https://w3c.github.io/uievents/#keydown says
However, in Chrome, Safari and Firefox, if you cancel a
beforeinput
event, noinput
event is fired.Chrome and Safari support
textInput
, and if you cancel that event, noinput
event is fired.So, assuming the correct event order for typing a single non-composing character in a text field is:
...the default actions should be:
During composition I think beforeinput isn't cancelable as implemented (try typing
¨
in the demo), andkeypress
isn't fired.The spec also says that
compositionupdate
andcompositionend
are not cancelable, but in Chrome and Safari they are. In Firefox they are not cancelable, andcompositionstart
is also not cancelable.The text was updated successfully, but these errors were encountered: