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
Check the console. Both resolver's return and formState: errors will contain two error fields (firstName and lastName).
The logic in the resolver is that at least one field is required.
After one field is filled both errors should be cleared.
Only respective error field is cleared.
Expected behaviour
It seems impossible to write a logic in the resolver to combine several fields where at least one satisfies some condition.
I understand there were similar bugs reported previously, such as #8819 but then how to implement this combined (with OR) logic in the resolver. This is very common requirement in the forms and current behavior seems very counter-intuitive.
What browsers are you seeing the problem on?
Firefox, Chrome, Safari, Edge
Relevant log output
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
croraf
changed the title
issue: Resolver's return error should set formState: {error}
issue: Resolver's return error should properly set formState: {error}
Apr 19, 2024
Version Number
7.51.3
Codesandbox/Expo snack
https://codesandbox.io/p/sandbox/hungry-panini-cfycjl?file=%2Fsrc%2FApp.tsx%3A8%2C18
Steps to reproduce
formState: errors
will contain two error fields (firstName
andlastName
).Expected behaviour
It seems impossible to write a logic in the resolver to combine several fields where at least one satisfies some condition.
I understand there were similar bugs reported previously, such as #8819 but then how to implement this combined (with OR) logic in the resolver. This is very common requirement in the forms and current behavior seems very counter-intuitive.
What browsers are you seeing the problem on?
Firefox, Chrome, Safari, Edge
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: