I've found what to me appears as a bug.
Bug
When a controlled input element changes by updating it's value, onChange isn't called.
Reproduction
I made a codepen that illustrates the problem; http://codepen.io/pudgereyem/live/bgmvOq
Expected behaviour
I expect that onChange gets called, since the <input/> did change, and the world of React is by nature very much "controlled".
This is written in the docs and also mentioned in various threads such as #8550 (comment) and #8696 (comment).
My problem
The fact that the inputs onChange function not gets called is a problem to me, because I need to do logic (such as validation) when the inputs have changed.
Comments
- I tried using
onInput also, but it doesn't get called either
I've found what to me appears as a bug.
Bug
When a controlled
inputelement changes by updating it's value,onChangeisn't called.Reproduction
I made a codepen that illustrates the problem; http://codepen.io/pudgereyem/live/bgmvOq
Expected behaviour
I expect that
onChangegets called, since the<input/>did change, and the world of React is by nature very much "controlled".This is written in the docs and also mentioned in various threads such as #8550 (comment) and #8696 (comment).
My problem
The fact that the inputs
onChangefunction not gets called is a problem to me, because I need to do logic (such as validation) when the inputs have changed.Comments
onInputalso, but it doesn't get called either