<p dir="auto">There seems to be a bug in the way React interfaces with controlled inputs of type number</p>
<p dir="auto">If the input contains an invalid number (let's say --2 or 2++), then trying to clear the input value by setting it to an empty string does nothing.</p>
<p dir="auto">You can check an example to reproduce there: <a href="https://jsfiddle.net/96bnn12r/2/" rel="nofollow">https://jsfiddle.net/96bnn12r/2/</a><br>
The onChange handler will set the controlled value to the value returned by ev.target.value.<br>
In the case of an invalid value, the input returns an empty string (as per html spec <a href="https://html.spec.whatwg.org/multipage/forms.html#states-of-the-type-attribute" rel="nofollow">https://html.spec.whatwg.org/multipage/forms.html#states-of-the-type-attribute</a> 4.10.5.1.12) so this should actually clear the input but the invalid input stays.</p>
<p dir="auto">When setting the input value to an empty string after entering an invalid value, it should clear the input content not keep the invalid value.</p>
<p dir="auto">Seen in React 0.14.8, 15.0.1, 15.1.0 on OSX Chrome v50, Firefox 46.0.1</p>
<p dir="auto">A controlled number input, without a corresponding <code class="notranslate">setState</code> function, still allows <code class="notranslate">e</code>, <code class="notranslate">-</code> and <code class="notranslate">.</code> to be entered (and numbers can be inputted afterwards). I could be incorrect but I don't believe this is the desired behavior.</p>
<p dir="auto"><a href="https://jsfiddle.net/vervujhm/" rel="nofollow">Here's a JSFiddle</a> demonstrating the issue.</p>