Skip to content

fix(forms/signals): make extractValue reactive for compat AbstractControl values#68202

Open
volkanfilazi wants to merge 2 commits intoangular:mainfrom
volkanfilazi:compat_form_unwraps_abst
Open

fix(forms/signals): make extractValue reactive for compat AbstractControl values#68202
volkanfilazi wants to merge 2 commits intoangular:mainfrom
volkanfilazi:compat_form_unwraps_abst

Conversation

@volkanfilazi
Copy link
Copy Markdown

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

extractValue no longer uses untracked, allowing signal reads during traversal to be tracked.
result:
computed(() => extractValue(...)) becomes reactive
effect re-runs when underlying AbstractControl values change
compat form values behave consistently with signal-based expectations

Reactive consumers are now correctly notified when control values update.

Issue Number: #68097

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

This change makes extractValue reactive, which may cause additional re-computations in cases where it was previously used as a purely imperative helper. However, this aligns better with expected signal behavior, especially in compatForm scenarios.

Other information

The issue was traced to the use of untracked in extractValue, which prevents dependency tracking. Removing it restores the reactive chain.

It is possible that extractValue was originally intended to be non-reactive. If so, an alternative approach could be to introduce a separate reactive API. However, this change fixes the current inconsistency where compat form values do not propagate updates through the signal graph.

A new test has been added to verify that reactive consumers are notified when AbstractControl values change.

@thePunderWoman thePunderWoman requested review from kirjs and leonsenft and removed request for devversion and thePunderWoman April 14, 2026 17:10
@pullapprove pullapprove bot requested a review from devversion April 14, 2026 17:10
@volkanfilazi volkanfilazi force-pushed the compat_form_unwraps_abst branch from 50cb495 to 58ae7a0 Compare April 14, 2026 17:19
@leonsenft
Copy link
Copy Markdown
Contributor

@volkanfilazi Thanks for the contribution. I'm going to discuss this fix in the original issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants