#ESC being the bind to close Drawer AND modal

8 messages · Page 1 of 1 (latest)

safe moat
#

Hi, so when I have a Drawer on my page, which is a list of things, and I have a button to delete from said list, I have a conformation modal. When I press escape, the desired outcome is for the conformation dialog to close, but because of how elements are set, it closes the drawer too. Is there a way to stop this behavior/for it to be fixed in a Mantine release? Thanks!

Here is the minimal reproduction: https://codesandbox.io/p/sandbox/mantine-react-template-forked-r5q3q9?file=%2Fsrc%2FDrawer.tsx%3A22%2C10

gray nexus
#

exists on both Modal and Drawer

safe moat
# gray nexus closeOnEscape={false}

I think you missunderstood my question. I would like for ESC to only close the modal, but for the drawer to also be closeable by ESC. Now one press of ESC closes both, if that makes sence?

gray nexus
safe moat