Changes to status not always being emitted to statusChanges observable for async validators.
fix(forms): changes to status not always being emitted to statusChanges observable for async validators. (#42553)
Changes to status not always being emitted to statusChanges observable for async validators.7180ec-fix-changes-to-status-not-always-beingfixchanges status always being emitted statuschanges
Committed by dylhunn
commit message
fix(forms): changes to status not always being emitted to statusChanges observable for async validators. (#42553)
When a FormControl, FormArray, or FormGroup is first constructed, if an async validator is attached, the `statusChanges` observable should receive a message when the validator complete (i.e. pending -> valid/invalid). If the validator was provided as part of the constructor options, it was not fired at construction time, which is fixed in this PR.
Fixes #35309.
PR Close #42553Editor assessment
The long subject states the defect - status changes not always emitted for async validators - and the body explains the mechanism precisely: statusChanges should fire when a constructor-attached async validator completes its pending-to-valid transition, but did not fire at construction. The well-formed Fixes footer anchors it. A trailing period on the subject is the main blemish. The forms scope and fix type are accurate. Publishable. The pending-to-valid transition and the constructor-attached validator case are specified precisely, which is what makes the diagnosis teach.