question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use of onInput in docs

See original GitHub issue

https://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:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
developitcommented, Oct 28, 2016

Good point, it’s definitely a little under-explained. onInput is used because preact doesn’t change the behavior of the DOM onchange event like React does. Instead, it encourages using the existing browser events under their existing names.

2reactions
developitcommented, Nov 1, 2016

@pl12133’s change is published, but I think it might be worth adding a blurb to the Linked State page abount onInput as well.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found