Properly handle the change to the FormGroup shape
fix(forms): properly handle the change to the FormGroup shape (#40829)
Properly handle the change to the FormGroup shapefixproperly handle change formgroup shape forms
Committed by AndrewKushnir
commit message
fix(forms): properly handle the change to the FormGroup shape (#40829)
Currently the code in the `FormGroupDirective` assumes that the shape of the underlying `FormGroup` never
changes and `FormControl`s are not replaced with other types. In practice this is possible and Forms code
should be able to process such changes in FormGroup shape.
This commit adds extra check to the `FormGroupDirective` class to avoid applying FormControl-specific to
other types.
Fixes #13788.
PR Close #40829Editor assessment
An exemplar. The subject names the behavioral gap - handling changes to the FormGroup shape - and the body teaches the whole story: the directive assumed the underlying FormGroup never changes and controls are never replaced, that assumption fails in practice, and an extra check now prevents applying FormControl-specific handling to other types. Motivation, flaw, and remedy in three sentences, with the issue linked and clean hygiene. Assumption, failure, and remedy are each given a sentence, which is the cleanest structure a behavioral fix message can have.