-
Notifications
You must be signed in to change notification settings - Fork 47.3k
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 type="number" onChange vs onInput #11142
Comments
tkrotoff
added a commit
to tkrotoff/react-form-with-constraints
that referenced
this issue
Oct 7, 2017
tkrotoff
added a commit
to tkrotoff/react-form-with-constraints
that referenced
this issue
Oct 7, 2017
Hey, @tkrotoff this is a known limitation for number inputs, see #6556. React will only emit a change event when the value of the input has actually changed, and when you enter an invalid number in a number input you get a value of |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With
<input type="number">
, when entering text ("eee"), onChange is not fired, onInput is.https://codepen.io/tkrotoff/pen/gGvvxw
Tested with React 16 + Chrome 61, Firefox 55, Safari 10.1.1 and Edge 38.14
DOM behavior (no React): https://codepen.io/tkrotoff/pen/RLQQqo
React onChange is not equivalent to DOM input event as it should.
The text was updated successfully, but these errors were encountered: