Answers for "i dont want my input tag to interact with Enter key in react"

0

react detect enter key

var Input = React.createClass({
  render: function () {
    return <input type="text" onKeyDown={this._handleKeyDown} />;
  },
  _handleKeyDown: function(e) {
    if (e.key === 'Enter') {
      console.log('do validate');
    }
  }
});
Posted by: Guest on November-29-2020

Code answers related to "i dont want my input tag to interact with Enter key in react"

Code answers related to "Javascript"

Browse Popular Code Answers by Language