Open bugproof opened 3 weeks ago
This might not be an issue with vaul itself but dialog in bits-ui next... https://github.com/huntabyte/bits-ui/commit/07bfcd44722d4b0dbcf1fa25d5932765ed993cd2
this is most likely bugged file : https://github.com/huntabyte/bits-ui/blob/next/packages/bits-ui/src/lib/internal/use-body-scroll-lock.svelte.ts
Interestingly this only happens in drawer. Dialog correctly resets to overflow: hidden auto but vaul stays at overflow:hidden...
I fixed this in code by doing:
<Drawer.Root bind:open={isOpen} onClose={() => document.body.style.overflow = "hidden auto"} preventScrollRestoration>
There is also some bug with scroll jumping back to the top of the page sometimes when closing the drawer...
Would you mind providing a reproduction of this? I'm not able to reproduce it with the docs site (see video below)
https://github.com/user-attachments/assets/0f0467c4-7b37-451b-aa45-2abb5c1c1bd5
just ran the docs site locally like you and I have this issue are you sure you've updated all packages? (bits-ui specifically) the docs site reproduces this.
https://github.com/user-attachments/assets/c4d48e0c-d594-42b8-9538-af0788ca3f4f
EDIT: after adding:
"pnpm": {
"overrides": {
"svelte": "5.1.0",
"bits-ui": "1.0.0-next.26"
}
}
It started working!! Couple of hours and it turned out to be a dependency issue.
vault-svelte dependencies need to be updated.
For some reason vaul-svelte was still using "bits-ui": "1.0.0-next.15",
even if I had "bits-ui": "1.0.0-next.26"
installed in my project.
I added this:
"pnpm": {
"overrides": {
"svelte": "5.1.0",
"bits-ui": "1.0.0-next.26"
}
}
and everything is fine now (I hope)... so vaul-svelte package needs to update it's dependencies for now above fix works for this. It was driving me nuts.
@huntabyte it's just a matter of updating packages and pushing new version of vaul-svelte... you can close this when it's done.
For me the bug somehow persists even with manual patching on the lastest 34. It only happens in nested components with overlays. It also only happens if I click the backdrop, if I use the close Button of the Drawer everything works fine. https://github.com/drloloto/shadtest.git
Describe the bug
those styles get added to body after closing the drawer which makes it impossible to scroll the page:
right: unset; pointer-events: auto; overflow: hidden;
so when drawer opens overflow:hidden is probably added to body to prevent scrolling the background but it is never cleared when closing the drawer... - correct me if my diagnosis is wrong. This works in svelte 4 version. Vaul pre-release version is completely unusable as a result.
Reproduction
will provide later
Logs
No response
System Info
Severity
blocking an upgrade