-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
Zod superRefine does not correctly revalidate the form on change #661
Comments
We have exactly the same error, we have it set that the start date must be smaller than the end date and when we set the start date later than the end date, an error appears, of course, but now if we set the end date to a later date than the start date, even though validation passes (correct behavior), the error does not disappear |
Same error for us! We have a |
Is there any workaround for this? |
I guess you can clear the errors yourself by calling |
Up ! is there a clean way to achieve this ? |
found a nice workaround from RHF: colinhacks/zod#2220 (comment) |
Describe the bug
The zod resolver doesn't seem to run the superRefine function correctly on form changes, it only works when changing the field defined in the path of the issue, but in this case I have errors based on the existance of data in other fields, so I expect this to work
To Reproduce
Steps to reproduce the behavior:
Codesandbox link (Required)
https://codesandbox.io/p/github/MattisAbrahamsson/rhf-zod-refine-minimal-reproduction/main
Expected behavior
I expect the resolver to revalidate my form when it changes, since
reValidateMode
is set toonChange
by default, and I have not opted out of it.The text was updated successfully, but these errors were encountered: