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
When using the move method of the useFieldArray hook, the dirtyFields of the formState only get the right value after being touched. When using a checkbox this needs to be clicked twice to update the dirtyFields.
To Reproduce
Steps to reproduce the behavior:
Go to the sandbox and show the console
Click on the move button
Notice an empty dirtyFields object in the logs
Uncheck the checked checkbox
Notice no log for dirtyFields in the console
Check the same checkbox again
Notice only this checked attribute in the dirtyFields and not the name attributes
Touch a name field and loose focus again
Notice this name field shows up in the dirtyFields
Codesandbox link (Required)
Include a codesandbox will help us to investigate the issue quicker.
Describe the bug
When using the move method of the useFieldArray hook, the dirtyFields of the formState only get the right value after being touched. When using a checkbox this needs to be clicked twice to update the dirtyFields.
To Reproduce
Steps to reproduce the behavior:
Codesandbox link (Required)
Include a codesandbox will help us to investigate the issue quicker.
Expected behavior
The dirtyFields object is updated when moving fieldArray fields based on the defaultValue of the fieldArray.
Desktop (please complete the following information):
Additional context
Using react-hook-form v6.14.0
The text was updated successfully, but these errors were encountered: