Skip to content

Commit

Permalink
fix: issue with scroll prevention (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte committed Jan 2, 2024
1 parent 3a1c9bf commit b3fbaa2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fresh-students-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vaul-svelte": patch
---

fix: issue with scroll prevention
4 changes: 2 additions & 2 deletions src/lib/internal/vaul.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@ export function createVaul(props: CreateVaulProps) {
});

// prevent scroll when the drawer is open
effect([isOpen, justReleased], ([$isOpen, $justReleased]) => {
effect([isOpen], ([$isOpen]) => {
let unsub = () => {};

if ($isOpen && !$justReleased) {
if ($isOpen) {
unsub = preventScroll();
}

Expand Down

0 comments on commit b3fbaa2

Please sign in to comment.