You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using async validation refinments, zodResolver seems to be the culprit in marking all fields as validating once the form is being submitted(as opposed to marking only the async refined fields)
To Reproduce
Steps to reproduce the behavior:
Set up a schema with a zodResolver and an Async field
Click on Submit
Only username is validating asyncronously
formState.validatingFields is marking all fields as validating
Interestingly, only clicking the submit button will mark all fields as validating (if validation is triggered by onChange, only the validating field is marked)
Expected behavior formState.validatingFields should only contain the fields that currently have an async validation running. Fields unaffected by that validation should not be contained in that object.
Screenshots
If applicable, add screenshots to help explain your problem.
Screen.Recording.2024-07-23.at.10.43.38.mov
Desktop (please complete the following information):
Describe the bug
When using async validation refinments, zodResolver seems to be the culprit in marking all fields as
validating
once the form is being submitted(as opposed to marking only the async refined fields)To Reproduce
Steps to reproduce the behavior:
username
is validating asyncronouslyformState.validatingFields
is marking all fields as validatingInterestingly, only clicking the submit button will mark all fields as validating (if validation is triggered by
onChange
, only the validating field is marked)Codesandbox link (Required)
https://codesandbox.io/p/sandbox/react-hook-form-async-field-validation-forked-5cclc6?file=%2Fsrc%2Findex.js%3A20%2C18
Expected behavior
formState.validatingFields
should only contain the fields that currently have an async validation running. Fields unaffected by that validation should not be contained in that object.Screenshots
If applicable, add screenshots to help explain your problem.
Screen.Recording.2024-07-23.at.10.43.38.mov
Desktop (please complete the following information):
I found this issue which seems to be relevant but couldn't find any resolution: react-hook-form/react-hook-form#5744
The text was updated successfully, but these errors were encountered: