Sitelet https://github.com/angular/angular/pull/70391
Skip to content

fix(forms): preserve intermediate keystrokes in signal formField - #70391

Open
shoemoney wants to merge 1 commit into
angular:mainfrom
shoemoney:fix/formfield-intermediate
Open

fix(forms): preserve intermediate keystrokes in signal formField#70391
shoemoney wants to merge 1 commit into
angular:mainfrom
shoemoney:fix/formfield-intermediate

Conversation

@shoemoney

Copy link
Copy Markdown

Fixes Signal Forms number [formField] overwriting intermediate keystrokes.

Bug: at control_native.ts:124 the native value write-back calls setNativeControlValue unconditionally when controlValue changes. For number inputs this normalizes the display string via valueAsNumber, dropping incomplete input such as '-' , '1.' and trailing zeros like '1.0' and '1.00' while the user is still typing.

Fix: guard the write-back when the input is focused and the current input.value is intermediate for the pending controlValue. isIntermediate returns true for '-' , '.' , trailing '.' and decimal strings whose numeric value equals controlValue but whose string differs from String(controlValue). In that case keep the raw pending string until blur.

Evidence: RED->GREEN verified with unit simulation for '-', '1.', '1.0', '1.00', '2.10' and formatter blast radius limited to one file. Prettier check passes.

Fix verified RED->GREEN. Signal Forms number [formField] overwrites intermediate keystrokes, dropping - and trailing zeros at control_native.ts:124
@pullapprove
pullapprove Bot requested a review from kirjs August 26, 2026 00:03
@ngbot ngbot Bot added this to the Backlog milestone Aug 26, 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.

1 participant