-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Open
Labels
needs triageThis issue needs to be triaged by the teamThis issue needs to be triaged by the team
Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
Template-driven forms, Reactive forms
Description
When you use a <mat-timepicker> inside a <mat-form-field>, as long as you connect the field to a template-driven [(ngModel)] or reactive [formControl], it will automatically validate that the value is a valid time, and if you input an invalid value, the form-field will turn red on blur.
However, if you connect the timepicker to a new Signal Forms form, it doesn't validate that the value is valid.
You can input any number like "123" or text like "abc" and the field doesn't show any red indication, and you are able to submit invalid values.
Reproduction
Steps to reproduce:
- The StackBlitz above compares the three form types (Template-driven, Reactive, Signal forms).
- The first two timepickers (Template-Driven & Reactive), turn red if you input an invalid value.
- The third timepicker (Signal form), doesn't turn red if you input an invalid value.
- In my project it also doesn't turn red when the field is clicked and blurred while empty, even though I've added a
required(fields.startTime);to the signal form, and it's adding an asterisk to the form-field indicating that it's required. (For some reason this specific point isn't reproducing in the stackblitz above.)
Expected Behavior
I expect two things:
- (a) When the field contains an invalid value like "123" or "abc", it should should have a red outline and the form should be "invalid".
- (b) When the field is empty and it's clicked then blurred, and there's a
required(...)validator, it should turn red.
Actual Behavior
There is no basic validation for empty/invalid values when using signal forms [field] with <mat-timepicker>.
Environment
- Angular: 21.0.3
- CDK/Material: 21.0.2
- Browser(s): Chrome
Metadata
Metadata
Assignees
Labels
needs triageThis issue needs to be triaged by the teamThis issue needs to be triaged by the team