Skip to content

fix(forms): prevent duplicate events and staleness on parseErrors updates - #71132

Open
JeanMeche wants to merge 1 commit into
angular:mainfrom
JeanMeche:fix/ng-control-parse-errors
Open

JeanMeche wants to merge 1 commit into
angular:mainfrom
JeanMeche:fix/ng-control-parse-errors

Conversation

@JeanMeche

@JeanMeche JeanMeche commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

This updates NgControl to directly evaluate the parseErrors computed signal inside its dynamic validator, rather than waiting for the effect to update a local variable. This allows synchronous validation updates to pick up the fresh parseErrors immediately during setValue, preventing stale states and duplicate valueChanges emissions when the effect runs later.

It also retains the ability for independent parseErrors changes to correctly update the control's validity silently. Furthermore, by manually calling markForCheck(), it fixes an issue where silent validation changes bypassed statusChanges and therefore failed to trigger view checks, which prevented control properties from being correctly synced down to the child components.

Fixes #71127

This updates NgControl to directly evaluate the parseErrors computed signal inside its dynamic validator, rather than waiting for the effect to update a local variable. This allows synchronous validation updates to pick up the fresh parseErrors immediately during setValue, preventing stale states and duplicate valueChanges emissions when the effect runs later.

It also retains the ability for independent parseErrors changes to correctly update the control's validity silently. Calling `markForCheck()` ensures the view is updated even when `statusChanges` does not emit.

Fixes angular#71127
@JeanMeche
JeanMeche force-pushed the fix/ng-control-parse-errors branch from 11a8ea8 to 7c10993 Compare October 2, 2026 00:55
@JeanMeche JeanMeche changed the title fix(forms): prevent duplicate valueChanges events on parseErrors update fix(forms): prevent duplicate events and staleness on parseErrors updates Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Signal Forms interop: transformedValue parse errors reach a FormValueControl one change detection late under ngModel and [formControl]

1 participant