title: Allow only positive values in html input element (including decimal values)
body: <p>I'm trying to create an input element that only allows positive numbers, including decimal values. It can't have leading zeros, it can't allow users to copy/paste an invalid value (eg. -14.5) in the field.</p>
  
  <p>What I have so far:</p>
  
  <pre><code>&lt;input type="number" onChange={this.handleChange} value={this.state.value}/&gt;
  
  private handleChange= (e) =&gt; {
          let amount = parseFloat(e.target.value);
  
          if (isNaN(amount) || amount &lt; 0) {
              amount = 0;
          }
  
          this.setState({value: amount});
  }
  </code></pre>
  
  <p>This works except it always keeps a leading zero. How can I fix it?</p>