Skip to content

Datepicker placeholder only clears after triggering its change detection (by clicking somewhere).. #13305

@ghost

Description

Bug, feature request, or proposal:

If you have a basic datepicker with floatLabel="never", its placeholder is not cleared on keyboard input. Only happens with invalid input ("abcd"), but it can be quite annoying because, if you are validating with some format like DD/MM/YY, the placeholder will only go away when you type exactly that format.

(Check stackblitz for a working example)

  • Placeholder overlaying input text:

screen shot 2018-09-25 at 17 26 40

What is the expected behavior?

Placeholder to be cleared on keyboard input.

What are the steps to reproduce?

Here is just a fork from the basic datepicker from documentation with added floatLabel="never". You should type an invalid date like "abc".

https://stackblitz.com/edit/angular-pr5nuh

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

Angular: 6.1.3
Material 6.4.6
Chrome 69 @ OSx

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions