React-hook-form: validationSchema not validating on the correct mode

Created on 24 Jul 2019  路  3Comments  路  Source: react-hook-form/react-hook-form

Describe the bug
When supplying a validationSchema, and mode onBlur the validation still triggers on change.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/react-hook-form-validationschema-f0nkm
  2. Click on the "Website" input
  3. Type "asdf"
  4. Observe that the validation error appears

Expected behavior
I expect the validation error not to appear until after I have triggered a blur event by leaving the "Website" input.

Additional Context
Seems to work after the initial blur?

After observing the issue:

  1. Delete the text from the input
  2. Trigger a blur
  3. Click on the "Website" input
  4. Type "asdf"
  5. Observe that the validation error only appear when blur is triggered
bug

All 3 comments

Thanks @stramel for the bug report, i have fixed the issue. will publish soon.

https://codesandbox.io/s/react-hook-form-validationschema-5qtti

3.18.11 馃憤

@bluebill1049 Appears to be working, thanks!

Was this page helpful?
0 / 5 - 0 ratings