Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-submittable

mapbox6.6kISC2.0.0

a replacement for preventing the default behavior of forms: allows submission on enter

submit, form, element, react

readme

react-submittable

build status Coverage Status

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

changelog

Changelog

2.0.0

  • react and react-dom are now peer dependencies, instead of regular dependencies.
  • dist/ no longer included in Git repo.
  • Switch prepublish build to prepublishOnly.

1.0.4

  • Babel fanciness to appease React 15.5.

1.0.3

  • Fixed: no longer passes ReactSubmittable's own props to the child <form> element.

1.0.2

  • Start this log