-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Description
Which @angular/* package(s) are the source of the bug?
forms
Is this a regression?
Yes
Description
Since version 21.2.0, an input of type date in a signal form, when the user erases its day, month or year, keeps its value instead of becoming empty, and becomes invalid with a parse error.
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/stackblitz-starters-a71rmrvl?file=src%2Fmain.ts
Please provide the exception or error you saw
When populating the birth date field and then erasing one or even all of its components (day, month or year), I expect the value to become empty again (or better: null, like when a number input is erased), and the required error to reappear. Instead, the value stays as it was before, the field becomes invalid, with a parse error.
Please provide the environment you discovered this bug in (run ng version)
Angular CLI : 21.1.5
Angular : 21.2.0
Node.js : 20.19.1
Package Manager : pnpm 8.15.6
Operating System : linux x64
┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build │ 21.1.5 │ ^21.1.5 │
│ @angular/cli │ 21.1.5 │ ^21.1.5 │
│ @angular/common │ 21.2.0 │ 21.2.0 │
│ @angular/compiler │ 21.2.0 │ 21.2.0 │
│ @angular/compiler-cli │ 21.2.0 │ 21.2.0 │
│ @angular/core │ 21.2.0 │ 21.2.0 │
│ @angular/forms │ 21.2.0 │ 21.2.0 │
│ @angular/platform-browser │ 21.2.0 │ 21.2.0 │
│ @angular/router │ 21.2.0 │ 21.2.0 │
│ rxjs │ 7.8.2 │ ^7.8.1 │
│ typescript │ 5.9.3 │ ^5.9.3 │
└───────────────────────────┴───────────────────┴───────────────────┘
Anything else?
Sorry for the edits on this issue. I intially thought there was no error at all, but that was because I tried to display the errors using the JSON pipe, which threw an error because parse errors are apparently not serializable to JSON. That could be a separate issue: it would be nice for errors to be serializable to JSON, at least to ease debugging.
Metadata
Metadata
Assignees
Type
Projects
Status