Skip to content

feat(date-picker): How to tell whether the picker has been touched? #21643

Description

@andreElrico

Feature Description

please refer: https://stackblitz.com/edit/angular-dfewqd?file=src/app/datepicker-disabled-example.html

how can we assess that the datepicker icon has been clicked (the popup opened) so essentially the control has been touched? (refer second datepicker in stackblitz)

Use Case

I want to style error state when control is invalid AND it has been touched (meaning the datepicker-popup opened already)

This currently does not work as the input in disabled and therefore it can never be touched :/.

Workaround

My workaround using click on the date-toggle does not work as the method _open() uses prevent-propagation.
The other option is to monkey patch _open(). Highly undesirable.

_open(event: Event): void {

would you consider the date-control is touched when the picker-popup has opened?

we could add @output or Observable for clicks on the triger button.

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/datepickerfeatureLabel used to distinguish feature request from other issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions