-
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
Opening or closing Dialogs with scrollbar-gutter: stable results in underlying page shifts #1436
Comments
Hey! We've deprecated https://github.com/tailwindlabs/headlessui/releases/tag/%40headlessui%2Freact%40v1.6.0 |
Thanks @adamwathan. I updated the repro to use |
Hey! Thank you for your bug report! This should be fixed by #1457, and will be available in the next release. You can already try it using:
Here is an updated CodeSandbox with the latest insiders build that fixes this issue: https://codesandbox.io/s/headless-ui-dialog-with-scrollbar-gutter-stable-forked-5o0y6z?file=/src/App.js |
Thanks for the speedy fix @RobinMalfait! I really appreciate it. |
Just in case it throws others off.... The background shift youssefm described is resolved (above pic, from his repo), but at first I didn't realize that the space where the scrollbar was (before Which of course makes sense, but prior to realizing that, I thought the shift issue was still a problem because no color was set on |
What package within Headless UI are you using?
@headlessui/react
What version of that package are you using?
1.6.1
What browser are you using?
Chrome
Reproduction URL
https://codesandbox.io/s/headless-ui-dialog-with-scrollbar-gutter-stable-tkkjib
Describe your issue
When you use
scrollbar-gutter: stable
and you open a HeadlessUI Dialog, the entire background shifts unnecessarily. This appears to be caused by the padding-right that's applied to the document element. scrollbar-gutter is an important CSS property for avoiding layout shifts during page load and it's unfortunate that its use results in a jarring visual experience alongside headlessui's Dialog.The text was updated successfully, but these errors were encountered: