Datepicker required validation is wrong #16761
Labels
area: material/datepicker
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Reproduction
StackBlitz example:
https://stackblitz.com/edit/angular-x2g8lj?file=app%2Fdatepicker-overview-example.ts
Steps to reproduce:
jjj
date.errors.required
is alwaystrue
for any invalid, non-empty valueExpected Behavior
Like with any other Angular Material component, using
Validators.Required
,date.errors.required
should betrue
ONLY when the datepicker value is EMPTY!So, for any non-empty invalid value, instead of:
there should be:
Also, instead of:
there should be:
as a value of
date.errors
object.matDatepickerParse
is a strange concept. Using a custom datepicker validator should be allowed instead of it.Actual Behavior
For invalid non-empty values, this is the control errors object:
Environment
The text was updated successfully, but these errors were encountered: