Normalized onChange event?
See original GitHub issueIn React, the onChange
event is normalized across browsers (at least as far back as IE9) so that it fires any time the content of an input changes (e.g. when the user types, backspaces, deletes, etc). Is there a similarly normalized event in preact?
Thanks!
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Normalized onChange event? #79 - preactjs/preact - GitHub
In React, the onChange event is normalized across browsers (at least as far back as IE9) so that it fires any time the...
Read more >Normalized and Raw Event Types - TechDocs
Normalized events are events that have been processed to use the alert properties defined in the USM schema. These events become CA SOI ......
Read more >onchange Event - W3Schools
The onchange event occurs when the value of an element has been changed. For radiobuttons and checkboxes, the onchange event occurs when the...
Read more >React onChange Events (With Examples) - Upmostly
The onChange event in React detects when the value of an input element changes. ... One of them is the normalized event system...
Read more >How to normalize an input (Colloquially known as how to ...
Again we have an onChange event in the input . We destructure the value from event.target.value . Then we set the last name...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The backspace/delete issue is only in IE9, the remainder of issues are for making checkboxes and radio buttons magically fire
onChange
handlers usingonClick
(not a logical choice IMO, since onChange works fine for uncontrolled components and onClick works fine for controlled components), and for some oddities around<select>
inputs that I have yet to observe in Preact (not sure why).Here’s React’s onChange abstraction: https://github.com/facebook/react/blob/master/src/renderers/dom/client/eventPlugins/ChangeEventPlugin.js
Since Preact tries to avoid browser hacks and legacy APIs whenever possible, I thinking we should move this issue into preact-compat, so we can track progress on it there.
preact-compat
doesn’t currently have any event normalization, but I think we’re going to need at least a rudimentary solution in order to have consistency when pulling in third party libraries.@chrisdavies I’m going to close this issue since there is now developit/preact-compat#20. Cheers!