ui icon indicating copy to clipboard operation
ui copied to clipboard

Option to disable drag on the content

Open bitdictator opened this issue 1 year ago • 3 comments

I am using the MyComponent component from npm @react-google-maps/api in the DrawerDescription.

I have these options for the GoogleMap component: const options = { disableDefaultUI: true, // Disable all default UI controls fullscreenControl: false, // Disable fullscreen control streetViewControl: false, // Disable street view control zoomControl: false, // Disable zoom controls keyboardShortcuts: false, // Disable keyboard shortcuts gestureHandling: "greedy", };

The issue I am experiencing is that whenever I drag down on the map, the Drawer slides down and closes. Its been 2 days and I can not find a way to disable drag on the area where content is displayed. It would be nice to have some sort of disableContentDrag property which allows drag only on the top line segment of the Drawer.

bitdictator avatar Jan 28 '24 22:01 bitdictator

Really needed configuration. I also have scrolling in x direction and it doesn't work smooth.

There should be prop to disableContentDrag. It should be work smooth like Instagram.

soham2k06 avatar Jan 30 '24 16:01 soham2k06

Found a workaround for this.

Upgrade the package vaul to >= 0.9.0.

Then set data-vaul-no-drag on elements you don't want to be draggable.

Ref: https://github.com/emilkowalski/vaul/issues/241

AndrewWalsh avatar Feb 04 '24 21:02 AndrewWalsh

Seems that data-vaul-no-drag works only on <DrawerContent /> and disables dragging only on the top handle sides. I need to disable dragging on everything except the top handle.

bitdictator avatar Feb 04 '24 22:02 bitdictator

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

shadcn avatar Feb 28 '24 23:02 shadcn

data-vaul-no-drag

I needed to place data-vaul-no-drag in every element tag in the <DrawerContent /> to make it work.

it will be nicer if we can just passed a disableOnDrag props to fix this

DevYemi avatar Mar 31 '24 14:03 DevYemi

Кажется, это data-vaul-no-dragработает только <DrawerContent />и отключает перетаскивание только по бокам верхней ручки. Мне нужно отключить перетаскивание всего, кроме верхнего маркера.

Did you somehow manage to solve this problem?

MirroxDev avatar Apr 20 '24 22:04 MirroxDev

Кажется, это data-vaul-no-dragработает только <DrawerContent />и отключает перетаскивание только по бокам верхней ручки. Мне нужно отключить перетаскивание всего, кроме верхнего маркера.

Did you somehow manage to solve this problem?

@MirroxDev Yeah i was able to solve this by passing dismissible={false} to the shadcn Drawer Component.

That helped solve the problem for me.

DevYemi avatar Apr 20 '24 23:04 DevYemi