You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a very particular use case: I need to have draggable elements inside the drawer. When an element starts being dragged, the drawer should close to reveal the drop area behind it. The problem is that the drag starts with a onPointerDown event and the onPointerUp event only happens after the drawer has already closed. This causes two problems:
If the user triggers a onPointerDown and immediately starts moving the pointer, the closing animation and the onDrag callback happen at the same time and causes a weird flickering;
Since onPointerUp is never triggered inside the drawer, the onRelease callback is never called and isDragging remains true. When I open the drawer a second time, onDrag will be called without I ever triggering the onPress callback.
Hey, @emilkowalski! Great work here.
I have a very particular use case: I need to have draggable elements inside the drawer. When an element starts being dragged, the drawer should close to reveal the drop area behind it. The problem is that the drag starts with a
onPointerDown
event and theonPointerUp
event only happens after the drawer has already closed. This causes two problems:onPointerDown
and immediately starts moving the pointer, the closing animation and theonDrag
callback happen at the same time and causes a weird flickering;onPointerUp
is never triggered inside the drawer, theonRelease
callback is never called andisDragging
remainstrue
. When I open the drawer a second time,onDrag
will be called without I ever triggering theonPress
callback.We don't need to actually put draggable elements inside the drawer to see it. A button that closes the drawer with
onPointerDown
is enough. Here's a reproduction: https://codesandbox.io/p/devbox/drawer-without-scale-forked-99shrnThere is also a recording of the problem:
vaul-issue.mp4
The text was updated successfully, but these errors were encountered: