emilkowalski / vaul

A drawer component for React.
https://vaul.emilkowal.ski
MIT License
6.02k stars 203 forks source link

Make data-vaul-no-drag work if any parent matches #267

Closed arsaizdihar closed 7 months ago

arsaizdihar commented 7 months ago

Currently, data-vaul-no-drag only worked if the dragged element is exactly the element that has the attribute. The expected behavior is it works if any of the parent (using element.closest) has the attribute. Fixes #266

vercel[bot] commented 7 months ago

@arsaizdihar is attempting to deploy a commit to the emil Team on Vercel.

A member of the Team first needs to authorize it.

Poylar commented 5 months ago

this still not working with Inputs fields

kyesildagli commented 3 months ago

Can someone please provide an example on how to use this attribute

arsaizdihar commented 3 months ago

Can someone please provide an example on how to use this attribute

You just need to add attribute data-vaul-no-drag to any element in the drawer and any drag on that element (and every children of it, recursively) wont move the drawer