emilkowalski / vaul

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

How to block drag completely? #287

Closed chladek closed 7 months ago

chladek commented 7 months ago

How to block drag completely? I know that there is data-vaul-no-drag, but this does not solve the problem. I need to pass this data to almost every element to block dragging. It is very tough task to pass that data to very large and nested components. At any time, someone can mistakenly add something new to the drawer and will be able to use the drag function.

There should be a prop disableDrag, which completely blocks the drag function. Or am i missing something?

emilkowalski commented 7 months ago

Use the dismissible prop, https://codesandbox.io/p/devbox/drawer-without-scale-forked-kxh9j5?file=%2Fapp%2Fmy-drawer.tsx%3A1%2C1

chladek commented 7 months ago

Thank you!