Replies: 2 comments
-
+1 |
Beta Was this translation helpful? Give feedback.
0 replies
-
I know this is an old thread but just in case others come across this. My solution:
You can give the same name to FormErrorScrollTarget as you give to useFieldArray and it will scroll to the div inside. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
when using a useFieldArray and we are getting error in root:
formState.errors.fields.root
how you can focus on some element, maybe a wrapper when the error occurs? Ref from root has only name in it and using it with setFocus does not do anything. Do you need a custom scroll to element? If I would do a custom one won't there be a race condition when error somewhere else occur? Then It will scroll to it as well through react-hook-form internal focus.
Beta Was this translation helpful? Give feedback.
All reactions