gcanti / tcomb-form

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

hasError doesn't prevent form submission #371

Closed Rowno closed 5 years ago

Rowno commented 7 years ago

Version

Expected behaviour

Setting the hasError field option should stop the form submitting. E.g:

{
  fields: {
    email: {
      error: 'An email address is already in use',
      hasError: true
    }
  }
}

Actual behaviour

The form submits and onSubmit is fired like nothing is wrong.

Steps to reproduce

  1. Set hasError to true for a field.
  2. Submit the form.