new FormControls with Validation pushed to a FormArray are always shown as invalid
Reproduction
https://stackblitz.com/edit/angular-material-5qkpvd
Steps to reproduce:
- click on "Add"
Expected Behavior
The new Field should not be shown as invalid. Other Fields of the FormArray should not be validated.
Actual Behavior
The new field is displayed as Invalid. All fields of the FormArray that are invalid are shown as invalid, although they are still untouched.
Environment
- Angular: 8.2.2
- CDK/Material: 8.2.2
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): macOS
The problem is that the add button doesn't have a type, which means that the browser will default it to submit, causing it to submit the form every time you click it. You can resolve it by adding type="button".
Sorry for the inconvenience and thank you very much for the answer! :)
I missed that...
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.