-
-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opening a drawer scrolls to the top #55
Comments
@jackvane Which version of Vaul are you using? This should be fixed in the latest one. |
@emilkowalski thanks for the quick response. This is the version I'm using:
|
@jackvane Could you make a demo with a reproduction on codesandbox? |
Also, which browser and OS are you using? |
Hmm, I couldn't seem to reproduce it in codesandbox But I can confirm to you that it is behaving as I'm seeing it in my project. Screen.Recording.2023-08-19.at.19.22.40.movI'm on MacOS Ventura 13.5 and the behavior was the same on both Google Chrome and Brave. The code is the exact same as from the example except that I'm passing an avatar component as a child to the trigger. |
There is nothing in the code that could be causing this issue. Are you sure this isn't something in your code? If that's not the case, please provide a reproducible example on codesandbox, as I can't reproduce this behavior myself. |
I fixed a related bug in #57, please re-open an issue with a reproduction if it persists. Thanks for reporting. |
I'll keep probing to see if I can find what the problem could be, the latest version did not fix the issue. Just a heads up, your latest version has a stray console log.
|
@jackvane Just seeing it now, let me know if you find out what the problem is. |
@emilkowalski It scrolls to the top if drawer opened and snaps back with a delay after it's closed, but not always. Screen.Recording.2023-09-12.at.20.55.07.movA hint to what this could be is that removing Screen.Recording.2023-09-12.at.21.00.41.movWe're using Radix's vanilla Dialog as well for desktop in the exact same pattern, the scroll issue isn't happening there, even when using an overlay. EDIT: this is with the latest 0.6.0 version and on Chrome (both desktop and mobile) |
Can you show me how your body and html styles look like @raimondlume? |
@emilkowalski And I got it reproduced as well https://codesandbox.io/p/sandbox/drawer-without-scale-forked-sjmrm7 🎉 Sidenote - this is recommended in TailwindUI's layouts |
Is it fixed on this preview url for you? https://vaul-git-fix-position-fixed-with-height-100-emilkowalski-s-team.vercel.app/ |
Seems that something's funky with the overflow there, can't seem to scroll at all |
Forgot to update body styles, can you try now? @raimondlume |
Seems to be resolved now 🙌 |
Fixed in #98 |
Thanks, you're amazing @emilkowalski! |
I have a button that opens up a drawer near the bottom of a page.
Whenever I open the drawer, it will automatically scroll to the top of the page, which is unwanted behavior. Can you make this opt in?
The code I used is the Without scaled background codesandbox example and I'm using Next JS.
The text was updated successfully, but these errors were encountered: