ui
ui copied to clipboard
Option to disable drag on the content
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.
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.
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
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.
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.
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
Кажется, это
data-vaul-no-drag
работает только<DrawerContent />
и отключает перетаскивание только по бокам верхней ручки. Мне нужно отключить перетаскивание всего, кроме верхнего маркера.
Did you somehow manage to solve this problem?
Кажется, это
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.