Skip to content

Commit

Permalink
fix: controlled animation issues (#49)
Browse files Browse the repository at this point in the history
* fix: controlled animation issues

* add changeset
  • Loading branch information
huntabyte authored Feb 6, 2024
1 parent 1a95737 commit b2aea43
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-news-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vaul-svelte": patch
---

fix: controlled animation issues
11 changes: 10 additions & 1 deletion src/lib/vaul/components/root.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@
export let direction: $$Props["direction"] = "bottom";
const {
states: { keyboardIsOpen, activeSnapPoint: localActiveSnapPoint, drawerId, openDrawerIds },
states: {
keyboardIsOpen,
activeSnapPoint: localActiveSnapPoint,
drawerId,
openDrawerIds,
isOpen,
},
methods: { closeDrawer, openDrawer },
options: { dismissible: localDismissible },
updateOption,
Expand Down Expand Up @@ -81,6 +87,9 @@
$: updateOption("backgroundColor", backgroundColor);
$: updateOption("dismissible", dismissible);
$: updateOption("direction", direction);
$: open && !$isOpen && openDrawer();
$: !open && $isOpen && closeDrawer();
</script>

<DialogPrimitive.Root
Expand Down

0 comments on commit b2aea43

Please sign in to comment.