Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shouldUseNativeValidation does not work properly with schema resolvers #182

Closed
ecklf opened this issue Jul 8, 2021 · 4 comments · Fixed by #183
Closed

shouldUseNativeValidation does not work properly with schema resolvers #182

ecklf opened this issue Jul 8, 2021 · 4 comments · Fixed by #183
Labels
bug Something isn't working

Comments

@ecklf
Copy link

ecklf commented Jul 8, 2021

Describe the bug
Form keeps staying in error state even though it is being changed into a valid state (cannot submit form).
I can confirm this issue for both yup and superstruct so I assume it will cause problems for all resolvers.

To Reproduce
Steps to reproduce the behavior:

  1. Use the official schema validation example https://react-hook-form.com/get-started#SchemaValidation
  2. Enable shouldUseNativeValidation

Codesandbox link (Required)
https://codesandbox.io/s/rhf-bug-hs2ux?file=/src/App.tsx

Expected behavior
Native validation message dismisses and form is submittable

Screenshots

Screen.Recording.2021-07-08.at.16.42.13.mov

Desktop (please complete the following information):

  • OS: macOS 11.4
  • Browser Chrome
  • Version 91.0.4472.114
@bluebill1049 bluebill1049 transferred this issue from react-hook-form/react-hook-form Jul 8, 2021
@bluebill1049
Copy link
Member

hey, @jorisre did some quick investigation, I think this problem occurred at the resolver not invoke setCustomValidty(true); to clear the error. Could you please take a look at it when you got a chance?

@bluebill1049 bluebill1049 added the bug Something isn't working label Jul 8, 2021
@jorisre jorisre linked a pull request Jul 11, 2021 that will close this issue
@jorisre
Copy link
Member

jorisre commented Jul 11, 2021

Thanks for reporting the issue. Should be fixed in #183

@ecklf
Copy link
Author

ecklf commented Jul 11, 2021

@jorisre I'll test this tomorrow and report back. Thanks in advance for the quick fix.

@ecklf
Copy link
Author

ecklf commented Jul 13, 2021

Tested and working for me 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants