react-submittable
v2.0.0
Published
a replacement for preventing the default behavior of forms: allows submission on enter
Downloads
1,221
Readme
react-submittable
Stop using preventDefault
to get form behavior in React.
<Submittable
onEnter={this.onEnter}
onCancel={this.onCancel}>
<input type='text' />
</Submittable>
The Submittable
component simulates the same enter & escape behaviors
you would get with the submit
event of an HTML form, without having to
shut down the default behavior. It also catches the escape key and calls
an onCancel
event when it sees it.
install
npm install --save react-submittable