Closed janhartmann closed 3 years ago
I just tried upgrading, and the bug is still there. When adding a new list of fields, the form becomes invalid. Go to https://codesandbox.io/s/romantic-ptolemy-nlgcc?file=/src/App.tsx and change the version to 7.6.2
can you share steps to reproduce the issue? (I followed the issue steps)
Hi again, I have a hard time reproducing it, but it still fails in my application. Only thing I wonder is that when I add a new row, it becomes invalid because there is a null
in the dirty fields?
https://codesandbox.io/s/romantic-ptolemy-nlgcc?file=/src/App.tsx
See the pre
at the bottom.
Thanks @janhartmann i will try again later this weekend, see if I can reproduce this issue. if anyone else having a similar issue, please help to reproduce the problem.
I was able to solve my problem in my application by not using a <Controller>
around my input
field (but registering directly on the input). I dont know if that helps you in any way, but I wanted to let you know. Thanks for an excellent library by the way.
Thanks @janhartmann interesting... i will take a deeper look this weekend anyhow.
Couldn't reproduce the issue... I am attaching a unit test for this, and feel free to follow me (anyone) up on this issue, if whoever can reproduce it in a codesandbox.
Describe the bug After upgrading to 7.X we are now experiencing problems with validation of fields inside
useFieldArray
.When adding a new row of fields, the form is invalid no matter if the fields has been filled out correctly. Removing the newly added row, makes the validation true. Only filling out the default row makes the form valid, however, adding two rows and remove the default one makes the form invalid.
To Reproduce Steps to reproduce the behavior:
Codesandbox link (Required) https://codesandbox.io/s/romantic-ptolemy-nlgcc?file=/src/App.tsx
Expected behavior The validation to form on dynamically added fields.