masonitedoors / MDL

Masonite Design Language components
https://masonitedoors.github.io/MDL
Apache License 2.0
5 stars 4 forks source link

Modal should close when "esc" is pressed #132

Closed josephfusco closed 3 years ago

josephfusco commented 4 years ago

Do you want to request a feature or report a bug?

Feature since we don't currently have this planned but is considered a bug in regards to web accessibility.

What is the current behavior?

Currently, when a modal/dialog is open, pressing the escape key does nothing.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:

N/A

What is the expected behavior?

When a modal/dialog is open, a user should be able to close it by pressing the escape key. This While a project consuming MDL can implement their own event handler for the escape key to toggle the show prop, I am proposing that this behavior be included out of the box with our modal components.

Which versions of MDL, and which browser / OS are affected by this issue? Did this work in previous versions of MDL?

N/A