emilkowalski / vaul

An unstyled drawer component for React.
https://vaul.emilkowal.ski
MIT License
5.27k stars 170 forks source link

drawer with modal=false still closes inappropriately #331

Closed artemis-prime closed 1 month ago

artemis-prime commented 2 months ago

Though #109 fixed the closing issue for general mouse clicks, it did not extend the fix to two other cases:

1) When the user clicks on a focusable element (button, input, etc) 2) When the user presses the ESC key.

Both of these still close the drawer, even if modal=false

This is specifically referenced in #37, and #114 This may also affect #184 and others

I'm attaching a PR to this.