Skip to content

feat(forms): support binding null to number input#66917

Draft
mmalerba wants to merge 3 commits intoangular:mainfrom
mmalerba:sf/number
Draft

feat(forms): support binding null to number input#66917
mmalerba wants to merge 3 commits intoangular:mainfrom
mmalerba:sf/number

Conversation

@mmalerba
Copy link
Contributor

@mmalerba mmalerba commented Feb 5, 2026

Supports binding null to a <input type=number>.

  • Treats a model value of null the same as a model value of NaN
  • When the user clears the input, reports null rather than NaN
  • When the user types an invalid number, model does not update, raises
    an error via the parse errors mechanism

Reoves the `parseErrors` property on `FormUiControl` and instead
introduces a new utility `transformedValue` that automatically handles
synchronizing the raw value and model value using the given `parse` and
`format` functions. It also automates the reporting of `parseErrors` to
the `FormField`, simplifying the API surface
Supports binding `null` to a `<input type=number>`.

- Treats a model value of `null` the same as a model value of `NaN`
- When the user clears the input, reports `null` rather than `NaN`
- When the user types an invalid number, model does not update, raises
  an error via the parse errors mechanism
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: forms labels Feb 5, 2026
@ngbot ngbot bot added this to the Backlog milestone Feb 5, 2026
@mmalerba mmalerba changed the title fix(forms): simplify design of parse errors feat(forms): support binding null to number input Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant