-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add "shouldDirty" to append from useFieldArray #3525
Comments
What's the use case? |
The use case is typically that I want my form array to always contain X items,
Given that the user has not interacted with the form, it doesn't make sense to have the form marked as dirty. Thanks in advance |
sounds legit. let's put on the feature board. |
After future investigation this is not possible or difficult to implement, because each input gets append/prepend will leave inputs as an empty string, which then fails against deep equal against |
It would be helpful to be able to add fields to a FieldArray in a non-dirty state. Sample use case:
Note: This form uses the isDirty property to show the user what field they have changed when editing a record, so all the fields in the new address instance show up as dirty. I am trying to come up with a work-around using some form of Also - @bluebill1049, you rock! Thanks for RHF. |
thanks for the feedback @ezrabowman related feature request: #8309 will probably get to it later in the stage, it's not a simple config update. I will mark this as duplicated and track it in the other one. |
Is your feature request related to a problem? Please describe.
would it be possible to add the "shouldDirty" flag to the append of useFieldArray ?
The shouldFocus already exist, so I guess it shouldn't be a big deal.
Thanks in advance
The text was updated successfully, but these errors were encountered: