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
Only changes to the last field in a field array are considered for validation when using superRefine. Changes to other fields are validated by zodResolver, but the resulting errors are not updated.
To Reproduce
Rule for all scenarios: names must be unique
Scenario 1:
Open sandbox link below
Change second input to "foo" to provoke error
Change first input to "bar" to resolve error
=> zodResolver error disappears, react-hook-form error remains (incorrectly)
Scenario 2:
Open sandbox link below
Change first input to "bar" to provoke error
=> react-hook-form errors are not updatefd (incorrectly)
Scenario 3 (positive):
Open sandbox link below
Change second input to "foo" to provoke error
Change second input back to "bar" to resolve error
=> zodResolver and react-hook-form errors disappear
Expected behavior
zodResolver error states are propagated to the useForm errors regardless of array position
Desktop (please complete the following information):
OS: MacOS
Browser: Brave
Version 1.63.169
Additional context
If the error state is reached by editing the first field (see scenario 2 above), the error from zodResolver is missing the ref object. This seems to be the missing link.
The text was updated successfully, but these errors were encountered:
Describe the bug
Only changes to the last field in a field array are considered for validation when using
superRefine
. Changes to other fields are validated byzodResolver
, but the resultingerrors
are not updated.To Reproduce
Rule for all scenarios: names must be unique
Scenario 1:
=> zodResolver error disappears, react-hook-form error remains (incorrectly)
Scenario 2:
=> react-hook-form errors are not updatefd (incorrectly)
Scenario 3 (positive):
=> zodResolver and react-hook-form errors disappear
Codesandbox link (Required)
Link
Expected behavior
zodResolver error states are propagated to the
useForm
errors regardless of array positionDesktop (please complete the following information):
Additional context
If the error state is reached by editing the first field (see scenario 2 above), the error from zodResolver is missing the
ref
object. This seems to be the missing link.The text was updated successfully, but these errors were encountered: