Open MattisAbrahamsson opened 5 months ago
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 refine
on a zod schema that applies an error message to the second of two form fields if the combination of both of the form fields is incorrect. We are only applying the error to the second field as that's where we would like to show the error message and autofocus on failed validation. The form does correctly pass validation if the first form field is updated, but the error on the second field never disappears. Would love to see this fixed!
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.