Reactive form validators not working when input for form groups is changed

Viewed 100

I have a form which takes an array of items and creates form groups based on this items. The first time my form loads, it does it correctly. But when the items array is changed, validation messages do not appear on the form group, but I can't submit my form because it's marked as invalid. This is how I give the data to my component:

<form-component [customFields]="customFields"
                section="{{constants.CUSTOM_FIELD_FEATURES_ID}}"
</form-component>

When the items array is changed, the function which creates the form is called again. It is exactly the same process. I checked the form which is created and it seems to be just the same.
At first, the validation works. Then I change the top selector, that changes the 'customFields' array (in this case it is the same data), the form is created again and then it doesn't work as you can see below. enter image description here

As I mentioned, for some reason the formgroup is marked as touched and invalid, but the entire form is created from 0.

0 Answers
Related