useFieldArray: How to revalidate fields when an item is removed #370
Unanswered
ayoshida1101
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Version: 5.1.5
Hello, I'm trying to make dynamic lists with
useFieldArray
.What I want is to revalidate all of the fields within a form when one of them is removed.
The given validator checks if there are any pairs of fields with duplicated values.
When one of the duplicated fields is removed, the other should be revalidated and its error needs to disappear.
However, with my code below, the error remains even after one of the duplicated fields is removed, and I can't figure out how to fire revalidation.
Is there any solution to this?
Although revalidation fires as I expect when I add
type="submit"
attribute to the remove button, I don't want to do thatThank you.
Beta Was this translation helpful? Give feedback.
All reactions