gcanti / tcomb-form

Forms library for react
https://gcanti.github.io/tcomb-form
MIT License
1.16k stars 136 forks source link

onSubmit on form gets hijacked by tcomb #387

Open abhishiv opened 7 years ago

abhishiv commented 7 years ago

Version

Tell us which versions you are using:

Expected behaviour

if t.form.Form is enclosed by a form, the onSubmit on that form should be triggered.

      <form onSubmit={this.handleSubmit}>
        <t.form.Form ref="form" value={this.state.value} onChange={this.handleChange} options={{}} type={Type} />
      </form>

Actual behaviour

Seems something in tcomb hijacks that event and is calling stopPropagation or something.

Steps to reproduce

Please visit the following codesandbox link, and try pressing enter on one of the inputs. You should have received an alert, however it's never called.

https://codesandbox.io/s/y81zG5mWV