Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent unintended blocking of drag between snap points #83

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/stupid-crabs-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vaul-vue": patch
---

fix: prevent unintended blocking of drag between snap points
4 changes: 2 additions & 2 deletions packages/vaul-vue/src/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ export function useDrawer(props: UseDrawerProps & DialogEmitHandlers): DrawerRoo
const isDraggingInDirection = draggedDistance > 0

// Pre condition for disallowing dragging in the close direction.
const noCloseSnapPointsPreCondition = snapPoints.value && !dismissible.value && !isDraggingInDirection
const noCloseSnapPointsPreCondition = snapPoints.value && !dismissible.value && !isDraggingInDirection && activeSnapPointIndex.value === 0

// Disallow dragging down to close when first snap point is the active one and dismissible prop is set to false.
if (noCloseSnapPointsPreCondition && activeSnapPointIndex.value === 0)
if (noCloseSnapPointsPreCondition)
return

// We need to capture last time when drag with scroll was triggered and have a timeout between
Expand Down