-
Notifications
You must be signed in to change notification settings - Fork 27.4k
input type=date .ng-valid-date stays after reset #13587
Comments
Yes, that looks like a bug. Thanks for reporting. |
It seems that when the field is empty the field-type-specific class is not affected. E.g. the same happens when clearing the date by deleting/unsetting each part (day, month, year). |
This is actually an issue for all validators (even though date input does the validation inside $parsers with parseError). Validators can only return |
Revisiting this, I think the behavior described in OP's post is as expected for when clearing the field. Currently, there is the problem of not running the validation when partially editing the date fields, but it will be fixed with The only thing that is a little weird (and probably needs further investigation) is the fact that (unlike other validators) the date validator does not initially add the |
Closing as a duplicate of #14740 (since that one has more discussion). Note to self, wrt:
The difference with other fields (e.g. |
Hello,
When I use Google Chrome with the input type date, there a cross that allow to reset the date.
I don't know if this is a bug or not since I'm very new to Angular but:
When I load the page, with the date set by the model to null

When I set the day, month and year it has the .ng-valid-date class

When I click on this cross, it has still the .ng-valid-date class but it's null again

The text was updated successfully, but these errors were encountered: