components icon indicating copy to clipboard operation
components copied to clipboard

Datepicker - When open, pressing Esc key should just close datepicker and stop event propagation

Open naveedahmed1 opened this issue 8 years ago • 3 comments

Bug, feature request, or proposal:

When a Datepicker is open, pressing Esc key closes it, which is fine. The issue arises when the parent component is also monitoring Esc key.

For example I have a form which contains the Datepicker component. I want the form to be closed when the user presses Esc key. But if the user has a Datepicker open, and presses Esc key, it closes the form, whereas it should only close the Datepicker.

What is the expected behavior?

Datepicker should stop propagation of the same event to the parent.

What are the steps to reproduce?

Visit https://stackblitz.com/edit/angular-b1wcka

Open datepicker and press Esc key to close datepicker, this will close the whole form instead of just closing the datepicker.

naveedahmed1 avatar Jul 24 '18 12:07 naveedahmed1

Sounds like this is related to the overlay keyboard dispatcher

jelbourn avatar Jul 24 '18 21:07 jelbourn

Happens with mat-select as well.

naveedahmed1 avatar Jul 30 '18 09:07 naveedahmed1

Having the same issue .... any News on this?

Dschuli avatar Mar 28 '20 14:03 Dschuli