Closed Dave-lab12 closed 5 months ago
Thank you Quick question: when I programmatically close the drawer it is not animating is that by design choice Repo: https://stackblitz.com/edit/vitejs-vite-pzyvfm?file=package.json
https://github.com/huntabyte/vaul-svelte/assets/56738450/209c6264-2b5e-4719-8101-27611e6bb184
The latest updates almost fixes the issue.
There are two remaining problems with programatic opening and closing of the drawer:
Should I create a new issue for those?
Can we re-open this issue please?
I'm also experiencing the same bug with programmatically closing the Drawer…
It does not work for me as well. I added bind:open
and set open
to false
from inside the modal and no animation (neither modal nor overlay) is visible. Uncontrolled usage works as expected.
My workaround:
// Drawer.svelte from shadcn-svelte.
// ...
export let open: $$Props['open'] = false;
$: (async () => {
if (!browser) {
return;
}
if (open) {
await sleep(10);
document.body.style.background = '#000000';
} else {
await sleep(350);
// Default body color, change according to your needs.
document.body.style.background = '#ffffff';
}
})();
+1, still not working. When you control drawer with bind:open
, there is animation on open = true
, but no animation on open = false
. Can we re-open this?
Hi;
Best to track it through this https://github.com/huntabyte/vaul-svelte/issues/52
In the meantime, input/feedback on this, https://github.com/huntabyte/vaul-svelte/issues/52#issuecomment-1943007872, would be good.
Describe the bug
I've encountered an issue where the animation for the drawer component ceases to function after programmatically opening and closing it. When using the
Drawer.Trigger
method, the animations perform as expected, smoothly opening and closing the drawer. However, when I attempt to control the drawer's visibility through direct programmatic methods, the animation no longer works. The drawer still opens and closes but without the intended animation, resulting in a less fluid user experience.Reproduction
https://stackblitz.com/edit/vitejs-vite-pzyvfm?file=src%2FApp.svelte
Logs
No response
System Info
Severity
annoyance