I thought that a disabled
control would not get validated. But I'm facing this issue.
I have reproduced using the official Angular reactive form sample:
https://stackblitz.com/edit/angular-hyvj24?file=src/app/dynamic-form-question.component.ts
If you type something in the email field and focus out, this will trigger the change
event in which I'm doing :
this.form.controls['firstName'].disable();
And although, firstname is NOT a required field, it gets validated and we see a red message. Without this line of code, firstName can be blank and we'll still be able to save.
Why is that ?