Skip to content

Instantly share code, notes, and snippets.

@webdevstar
Created September 13, 2018 22:21
Show Gist options
  • Save webdevstar/29fcefc07b82d5fb243f409f34bb78bd to your computer and use it in GitHub Desktop.
Save webdevstar/29fcefc07b82d5fb243f409f34bb78bd to your computer and use it in GitHub Desktop.
React Key events
handleKeyPress = (event) => {
if(event.key == 'Enter'){
console.log('enter press here! ')
}
}
render: function(){
return(
<div>
<input type="text" id="one" onKeyPress={this.handleKeyPress} />
</div>
);
}
@kinddeveloper
Copy link

Recently, the current keypress issue has been fixed by above way.

@nodetop
Copy link

nodetop commented Oct 3, 2018

thanks

@filip1991903
Copy link

best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment