-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Bug]: Modal jumps horizontally when closing (on Windows) #421
Comments
There's a video of the jump in this comment: #365 (reply in thread) |
It can be fixed like this: https://codesandbox.io/s/headlessui-dialog-scroll-jumping-fix-f6uxv?file=/pages/index.js |
Hey! Thank you for your bug report! This should be fixed in the latest version! However, make sure to cleanup some of |
Thanks Robin! Can confirm it works now (after updating the modal code to the latest example on TailwindUI) |
What package within Headless UI are you using?
@headlessui/vue
What version of that package are you using?
1.0.0
What browser are you using?
Chrome on Windows 10
Reproduction repository
https://www.youtube.com/watch?v=aYMffRukfCA
Describe your issue
If you have a modal component that is centered horizontally and the page has a vertical scrollbar the modal jumps to the left when you close it.
Headlessui adds padding-right to compensate for "hiding" the scrollbar when a modal opens. Which is good, since it prevents annoying page jumps. However, when you close the modal the padding is removed while the hiding animation is not finished yet. This causes the modal to jump to the left.
My guess is, the padding should be removed after the animation.
Ps. I used a dialog from tailwindui to test the headlessui components.
The text was updated successfully, but these errors were encountered: