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
I'm working on a form with a field array. It is not mandatory to add an entry to the field array but if an entry is added, then the first value of this entry is mandatory (see Parameter in screenshot). The values are set and updated correctly and formState.isValid shows the correct result. However, when I add a new entry with append I want the FormSelect to have a red background as it is still empty and thus invalid. I use the same FormSelect outside of the FieldArray where it works as desired (see Reliability of data in screenshot).
When I logged the formState within FormSelect I noted that it lists no error for the Parameter field, so I've tried adding formMethods.trigger() once after append and once within
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on a form with a field array. It is not mandatory to add an entry to the field array but if an entry is added, then the first value of this entry is mandatory (see Parameter in screenshot). The values are set and updated correctly and
formState.isValid
shows the correct result. However, when I add a new entry withappend
I want the FormSelect to have a red background as it is still empty and thus invalid. I use the sameFormSelect
outside of the FieldArray where it works as desired (see Reliability of data in screenshot).When I logged the formState within
FormSelect
I noted that it lists no error for the Parameter field, so I've tried addingformMethods.trigger()
once afterappend
and once withinunfortunately without success (I did not commit these changes as they didn't help).
I've also tried to add a
Controller
around theFormField
ofFormSelect
(like I did in FormMultiSelect but this also didn't help.Any input on how I could fix this problem would be greatly appreciated. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions