Use of onInput in docs
See original GitHub issuehttps://preactjs.com/guide/linked-state#linked-state-to-the-rescue
onInput
is used to update state, but https://facebook.github.io/react/docs/forms.html recommends avoiding onInput
and using onChange
instead. Might be worth changing to onChange
or adding a note to explain why onInput
should be used despite React’s advice.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:8 (5 by maintainers)
Top Results From Across the Web
oninput Event - W3Schools
Definition and Usage ... The oninput event occurs when an element gets user input. This event occurs when the value of an <input>...
Read more >HTML oninput Event Attribute
The oninput attribute fires when the value of an <input> or <textarea> element is changed. Tip: This event is similar to the onchange...
Read more >GlobalEventHandlers.oninput - Web APIs
The oninput property of the GlobalEventHandlers mixin is an EventHandler that processes input events on the <input> , <select> , and <textarea> elements....
Read more >HTMLElement: input event - Web APIs | MDN
The input event fires when the value of an <input> , <select> , or <textarea> element has been changed. The event also applies...
Read more >w2form.onInput | JavaScript UI - w2ui
onInput = function(event). This event is triggered each time user types within a form field. In the event object you can find the...
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 FreeTop 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
Top GitHub Comments
Good point, it’s definitely a little under-explained.
onInput
is used because preact doesn’t change the behavior of the DOMonchange
event like React does. Instead, it encourages using the existing browser events under their existing names.@pl12133’s change is published, but I think it might be worth adding a blurb to the Linked State page abount onInput as well.