title: AntDesign validation Typography editable text
body: <p>I'm trying to validate when the user is typing in the Antd Design Text, so that it does not let him write other value than numbers and onchange does not return anything.</p>
  <p>&quot;antd&quot;: &quot;^4.3.3&quot;,
  &quot;react&quot;: &quot;^16.13.1&quot;</p>
  <pre class="lang-js prettyprint-override"><code>import React from &quot;react&quot;;
  import { Typography } from &quot;antd&quot;;
  const { Text } = Typography;
  
  export default class Demo extends React.Component {
      state = {
          price: 0,
      };
  
      onChange = (price) =&gt; {
          let isValid= validatePriceRegex(price);
          console.log(isValid, &quot;Price:&quot;, price);
          this.setState({ price});
      };
  
      handleChange = (e) =&gt; {
          // In this part, I want to validate the input when the user is typing the value
          console.log(e); // dont return anything
      };
  
      render() {
          return (
              &lt;Text
                  onChange={this.handleChange}
                  editable={{ onChange: this.onChange }}
              &gt;
                  {this.state.price.toString()}
              &lt;/Text&gt;
          );
      }
  }
  
  const validatePriceRegex = (price) =&gt; {
      const regex = /^\$?\d+(,\d{3})*(\.\d*)?$/;
      return price &amp;&amp; regex.test(price);
  };
  
  </code></pre>