Reputation: 4011
I'm using mat-stepper component of Angular Material, as a multi-form steps.
I'd like to prevent the following behaviour:
Why is the new item already invalid? I've noticed it has already a mat-form-field-invalid class...
Any hints? Thanks!
Upvotes: 1
Views: 1530
Reputation: 356
What this answer says is that validation is running on the full step form whenever a step has been "interacted".
So a workaround for your case would be to add the control without any validator (nor required attribute in the template), and to set them whenever the user goes to another step (with the MatStepper selectionChange output).
Upvotes: 0