Repository navigation
Open
Milestone
Description
Which @angular/* package(s) are the source of the bug?
forms
Is this a regression?
Yes
Description
When using Signal Forms in Angular v22 with a standard text input (e.g., ), if the model's value is
programmatically set to null (or receives null as an initial/updated value), the form control incorrectly treats/coerces this value
as a numeric type instead of remaining null or an empty string.
This is a regression, as the exact same implementation worked correctly and preserved the expected text/null type in Angular v21. This
is particularly noticeable on typed string fields or generic text fields where passing null unexpectedly alters the
value type.
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/stackblitz-starters-dv7tq7dq
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run ng version)
Angular CLI : 22.0.0
Angular : 22.0.0
Node.js : 26.0.0
Package Manager : npm 11.12.1
Operating System : darwin arm64
┌───────────────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────────────┼───────────────────┼───────────────────┤
│ @angular-devkit/architect │ 0.2200.0 │ ^0.2200.0 │
│ @angular-devkit/core │ 22.0.0 │ ^22.0.0 │
│ @angular/build │ 22.0.0 │ ^22.0.0 │
│ @angular/cdk │ 21.2.8 │ ^21.2.8 │
│ @angular/cli │ 22.0.0 │ ^22.0.0 │
│ @angular/common │ 22.0.0 │ ^22.0.0 │
│ @angular/compiler │ 22.0.0 │ ^22.0.0 │
│ @angular/compiler-cli │ 22.0.0 │ ^22.0.0 │
│ @angular/core │ 22.0.0 │ ^22.0.0 │
│ @angular/forms │ 22.0.0 │ ^22.0.0 │
│ @angular/platform-browser │ 22.0.0 │ ^22.0.0 │
│ @angular/platform-browser-dynamic │ 22.0.0 │ ^22.0.0 │
│ @angular/router │ 22.0.0 │ ^22.0.0 │
│ ng-packagr │ 22.0.0 │ ^22.0.0 │
│ rxjs │ 7.8.2 │ ~7.8.0 │
│ typescript │ 6.0.3 │ ~6.0.3 │
│ vitest │ 4.1.5 │ ^4.0.8 │
└───────────────────────────────────┴───────────────────┴───────────────────┘
Anything else?
No response
Reacted by Vincent Lycoops, JB Nizet, Thomas Demoulin and Pablo Maurer
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
hawkgs commentedon Jul 13, 2026
@xMikee, I took a look at your StackBlitz demo, but I am not sure I found an issue in it.
this.form.isbn()isFieldState<string | null, string>, which is expected{ "isbn": null }Your
test-fieldcomponent accepts a fieldinputwith a wide range of types (string | number | boolean | null).MeAkib commentedon Jul 13, 2026
You'll get some info here
xMikee commentedon Jul 13, 2026
Just to confirm: if I receive a null string field from the backend, do I have to map it to the signal as an empty string? Otherwise, the behavior is what I’ve attached—meaning the form doesn't validate the field correctly.

JeanMeche commentedon Jul 13, 2026
Having a dynamic input type comes with some caveats. Typechecking won't be able to pick up that
nullissue (as the type is equivalent toany). Maybe in this case we should at least log a runtime warning when a text input recieves anullvalue.hawkgs commentedon Jul 13, 2026
Yes. Please ignore my initial comment. This should be relevant: https://angular.dev/guide/forms/signals/models#initializing-all-fields (
HELPFULtip).Indeed, in your case the input type of
test-inputmasks the issue so you don't get an error (we should probably have a runtime one as Matthieu pointed).AdamSheaffer commentedon Jul 13, 2026
I'd also recommend updating this section of the documentation to include this gotcha https://angular.dev/guide/forms/signals/models#example-loading-data-from-an-api
More often than not, data returned from API's will likely contain nullable strings, so I suspect developers will need to be guided towards the pattern of regularly creating new types for form objects and mapping them to/from their API models
JeanMeche commentedon Jul 13, 2026
This is a parsing issue though. This should be caught correctly by for example, relying on schema validation (zod, valibot etc).
AdamSheaffer commentedon Jul 13, 2026
This is a good message to put in the documentation
wartab commentedon Sep 2, 2026
We were just bitten by this as well.
I think falling back to strings or (if possible) to a sensible type for the input-type for null values would make sense to avoid breaking unexpected cases.