huntabyte / vaul-svelte

An unstyled drawer component for Svelte.
https://vaul-svelte.com
MIT License
467 stars 19 forks source link

Nested Drawer drag close also closes the parent drawer. #87

Open theetherGit opened 3 months ago

theetherGit commented 3 months ago

Describe the bug

When we use nested drawer and we use drag close on nested drawer it also closes parent drawer.

Issue: https://stackblitz.com/edit/vaul-svelte-nested-drawers?file=src%2Froutes%2F%2Bpage.svelte - Svelte Version

https://github.com/user-attachments/assets/06ece19c-a3bd-4f0e-9311-96fa271178b0

Expected Behaviour: https://codesandbox.io/p/devbox/drawer-non-dismissable-forked-5z2r3j?file=%2Fapp%2Fmy-drawer.tsx - React version

https://github.com/user-attachments/assets/e7e8df98-a7a5-4f08-b340-d10f4371c62b

Reproduction

Use https://www.vaul-svelte.com/examples - nested drawer here and you will see when closing nested drawer by drag also closes parent drawer.

Logs

No response

System Info

System:
    OS: macOS 14.3
    CPU: (10) arm64 Apple M2 Pro
    Memory: 81.92 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
    npm: 10.4.0 - ~/.nvm/versions/node/v20.11.0/bin/npm
    pnpm: 9.4.0 - ~/Library/pnpm/pnpm
    bun: 1.1.7 - ~/.bun/bin/bun
  Browsers:
    Brave Browser: 126.1.67.123
    Chrome: 126.0.6478.183
    Safari: 17.3
    Safari Technology Preview: 17.4
  npmPackages:
    @sveltejs/kit: ^2.5.18 => 2.5.18 
    bits-ui: ^0.21.12 => 0.21.12 
    svelte: ^4.2.18 => 4.2.18 
    typescript: ^5.5.4 => 5.5.4 
    vaul-svelte: ^0.3.2 => 0.3.2 

- Tested on chrome only.

Severity

blocking all usage of vaul-svelte

mustafa0x commented 2 months ago

I too found this behavior odd. Awesome component btw!