Skip to content

fix(forms): keep transformed values in sync after reactive resets - #72074

Open
vivekjm wants to merge 2 commits into
angular:mainfrom
vivekjm:fix/forms-transformed-value-reset
Open

vivekjm wants to merge 2 commits into
angular:mainfrom
vivekjm:fix/forms-transformed-value-reset

Conversation

@vivekjm

@vivekjm vivekjm commented Nov 17, 2026

Copy link
Copy Markdown

PR Checklist

  • The commit message follows the contribution guidelines.
  • A regression test covers the change.
  • Docs have been added or updated.

PR Type

  • Bugfix

What is the current behavior?

Resetting a reactive control and restoring its previous value before the next render can leave a custom input using transformedValue blank. The reset callback updates the raw value immediately, while the custom control's model and its last bound value still hold the previous value.

What is the new behavior?

Write the reset value to the custom control's model and update its last bound value before invoking the reset callback. A subsequent write of the previous value then reaches the model and restores the formatted input.

Fixes #72068.

Does this PR introduce a breaking change?

  • Yes
  • No

Validation

  • The new regression failed on main with an empty input and passed with the fix.
  • The Chromium Signal Forms and reactive forms suites passed, as did the Node forms suite and dependency checks.
  • Firefox could not start locally because it could not open the test profile. The same launch error occurred on main before the change.

Write the reset value to the custom control model before resetting its raw value. A subsequent write of the original value before rendering must then reach the custom control.
@ngbot ngbot Bot added this to the Backlog milestone Nov 17, 2026
@pullapprove
pullapprove Bot requested a review from kirjs November 17, 2026 07:15
@alxhub alxhub added the target: patch This PR is targeted for the next patch release label Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: forms target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reactive forms: transformedValue control shows an empty value after reset() followed by setting the previous value

2 participants