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

input event should use InputEvent #682

Open
domenic opened this issue Feb 11, 2016 · 2 comments
Open

input event should use InputEvent #682

domenic opened this issue Feb 11, 2016 · 2 comments
Labels
addition/proposal New features or enhancements interop Implementations are not interoperable with each other topic: events

Comments

@domenic
Copy link
Member

domenic commented Feb 11, 2016

http://w3c.github.io/editing/input-events.html defines a new InputEvent type that it clearly intends to be used for the HTML input event defined in https://html.spec.whatwg.org/#event-input. However, it never defines the actual procedure by which these events are created or fired, or how their initialization values are determined. (It has some vague stuff like "A user agent MUST dispatch this event immediately after the DOM has been updated." but that clearly doesn't fit into the existing lifecycle; compare it to the spec's existing "Queue a task to fire a simple event that bubbles named input at the input element.") Furthermore, HTML currently says to dispatch a plain ol' Event.

It seems, based on blink-dev, there is public support for this change. We should update HTML.

See also #601.

@domenic domenic added the addition/proposal New features or enhancements label Feb 11, 2016
@zcorpan
Copy link
Member

zcorpan commented Feb 12, 2016

cc @johanneswilm

@jimmywarting
Copy link

jimmywarting commented Jul 20, 2022

This is bugging me now that an InputEvent isn't triggered. It behaving differently on firefox and other browsers...
I'm using a Datalist as autocompletion, and whenever something is selected then i would like to know about it via InputEvent.prototype.inputType. I can't do that if a normal Event is dispatched. cuz Event dose not have inputType

Also if you click with a mouse (using chrome) to select something then it will dispatch a normal Event and fire the onkeydown handler. the event.type is still weirdly keydown. never was any keyboard button pressed while only using the mouse. Firefox don't trigger this onkeydown event when using the mouse

demo: https://jsfiddle.net/aLes7n6q/
chrome behaves weird, and triggers both event handlers,
I think Firefox got this right and it also uses inputType=insertReplacementText

@domenic domenic added the interop Implementations are not interoperable with each other label Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements interop Implementations are not interoperable with each other topic: events
Development

No branches or pull requests

3 participants