You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Signal forms: select is not resynced when the text of an option without a value changes #71443
A <select> bound with [formField] keeps its value in sync with the model by watching its options with a MutationObserver. The observer is set up with characterData: true because an <option> without a value attribute uses its text as its value. However isRelevantSelectMutation in packages/forms/signals/src/directive/select.ts only treats a mutation as relevant when nodes were added or removed. A characterData record never has added or removed nodes, so text changes are always ignored.
As a result, when the model value matches an option only after that option's text changes, the select stays on no selection.
What should happen
When the text of an option changes so that it now matches the model value, the select should show that option as selected, the same as when a matching option is added.
For a characterData record addedNodes and removedNodes are empty, so the function returns false. A text node data change on a non comment node should be treated as relevant.
Activity