Issue with escape key behavior in multi-dialog flow #2324
Replies: 2 comments
-
Same issue and it is weird. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hey, thank you for your question! 🙏 We don't support multiple dialogs at the same time unless they are nested. This is needed so that we can have a proper hierarchy and if multiple dialogs are open then we know the order and know which dialog to close on outside click / escape. Here is an updated CodeSandbox where the second dialog is nested: https://codesandbox.io/s/escape-key-doesnt-close-most-recent-modal-forked-7b67ce?file=/src/App.js |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
HI! I came across an issue with the Dialog component where the escape key doesn't behave as expected when multiple dialogs are open
I have a state in my app where I confirm deletion by showing a Dialog on top of the already present Dialog and I feel that hitting escape should close the most recently opened dialog, but instead, it closes the first dialog. However, when I click outside the dialogs, it closes the most recent one, which is what I'd expect the escape key to do too
I've tested this on both version 1.6.6 (which is what we're running) and the latest version, and it's still an issue. You can reproduce it by checking out the provided minimal example: https://codesandbox.io/s/escape-key-doesnt-close-most-recent-modal-msxx04?file=/src/App.js.
Beta Was this translation helpful? Give feedback.
All reactions