Here's the element I have:
React.DOM.input({onKeyPress: this.onKeyPress});
onKeyPress: function(event) {
if (event.keyCode === 13) // Enter key
event.preventDefault();
}
With react 0.10, preventDefault was working. On 0.11, with the focus on the input, pressing enter does a form submit and reloads the page.
I've also tried doing the preventDefault on the onKeyDown event with no luck.
Here's the element I have:
React.DOM.input({onKeyPress: this.onKeyPress});
onKeyPress: function(event) {
if (event.keyCode === 13) // Enter key
event.preventDefault();
}
With react 0.10, preventDefault was working. On 0.11, with the focus on the input, pressing enter does a form submit and reloads the page.
I've also tried doing the preventDefault on the onKeyDown event with no luck.