Skip to content

DatePicker "matDatepickerParse" validator not working on first time value change. #11523

Closed
@keatkeat87

Description

@keatkeat87

Bug, feature request, or proposal:

Bug

What is the expected behavior?

it will run validate all the time.

What is the current behavior?

it will run validate only after i select a date.

What are the steps to reproduce?

Providing a StackBlitz reproduction is the best way to share your issue.

StackBlitz starter: https://stackblitz.com/edit/angular-szevpj?file=app/datepicker-filter-example.html

step to fail :

  1. keyin value 'abc' in datepicker input
  2. unblur the input
  3. you should see the 'required' and 'matDatepickerParse' error, but 'matDatepickerParse' missing.

step to success :

  1. select a date first
  2. change input value to 'abc'.
  3. you will see the 'required' and 'matDatepickerParse' error. it is expected behavior.

What is the use-case or motivation for changing an existing behavior?

In Material 5.x, it work as expected.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 6.0.3
Material 6.1.0

Is there anything else we should know?

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/datepicker

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions