Skip to content

Commit

Permalink
fix: dragging upward was prevented
Browse files Browse the repository at this point in the history
* "Do not allow dragging downwards to close if the first snap point is the active one and dismissible prop is set to false" had previously also prevented dragging upwards.

The change now also checks the direction in which the pull is made so that it can still be pulled upwards.

* Add changeset

* Create blue-stingrays-sleep.md
  • Loading branch information
mforstme authored Jun 15, 2024
1 parent 12ab3e8 commit 2dd8e2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/curvy-sheep-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vaul-vue": patch
---

Allow for Upward Dragging in Scenario Involving Snap Points and Dismissible Prop
2 changes: 1 addition & 1 deletion packages/vaul-vue/src/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export function useDrawer(props: UseDrawerProps & DialogEmitHandlers): DrawerRoo
const isDraggingDown = draggedDistance > 0

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

if (!isAllowedToDrag.value && !shouldDrag(event.target, isDraggingDown))
Expand Down

0 comments on commit 2dd8e2c

Please sign in to comment.