Skip to content

fix(forms): resync select when option text changes - #71444

Open
auraseb wants to merge 1 commit into
angular:mainfrom
auraseb:fix/signal-forms-select-option-text-resync
Open

auraseb wants to merge 1 commit into
angular:mainfrom
auraseb:fix/signal-forms-select-option-text-resync

Conversation

@auraseb

@auraseb auraseb commented Oct 20, 2026

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?

The MutationObserver that keeps a [formField] bound <select> in sync observes characterData, because an <option> without a value uses its text as its value. isRelevantSelectMutation only returns true when nodes were added or removed, which is never the case for a characterData record. So when an option's text changes to match the model value, the select is not resynced and shows no selection.

Issue Number: N/A

What is the new behavior?

A characterData mutation on a non comment node is treated as relevant, so the select is resynced to the model value. Added a test next to the existing "should resync the select value when an option is added" test.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Fixes #71443

Signed-off-by: Sebastian Turner <sebastiant3484@gmail.com>
@pullapprove
pullapprove Bot requested a review from JeanMeche October 20, 2026 03:32
@ngbot ngbot Bot added this to the Backlog milestone Oct 20, 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: select is not resynced when the text of an option without a value changes

1 participant