-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[Modal] Issue with overflow-y: scroll on <html> #34513
Comments
Could you please provide a simple codesandbox showing the problem so we can reproduce the issue and verify any potential solutions? |
Well, I guess I don't know how to provide an example, it's really simple, I just want to use |
Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information. |
This should already be supported, I did the work in #17972. |
A reproduction that demonstrates that it already works: https://codesandbox.io/s/nervous-sutherland-ism1ch?file=/demo.tsx |
scrollContainer
for ModalManager
scrollContainer
for ModalManager
scrollContainer
for ModalManager
Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information. |
I suspect that If you have an extension, the Having a new https://www.w3.org/WAI/ARIA/apg/patterns/dialogmodal/ and that it also makes sense to disable the scroll on something that isn't the Anyway, I'm leaving this discussion here. I have only engaged here because I was fixing the bot that handles |
Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information. |
hello! @oliviertassinari please re-open this issue please! I have made a partially reproduction environment here: https://codesandbox.io/s/blissful-bassi-0bjynp There are two problems with the current implementation in our environment:
Adding a |
I can reproduce the issue: https://codesandbox.io/s/vigilant-glitter-7i5plg?file=/src/index.tsx |
@oliviertassinari we also need specific styles in the root html that affect overflow behavior. Our use case is to avoid jumping the content when the content is long enough to add a scrollbar. We have the content of the website to be center aligned with margin-left and -right set to Our css looks a bit like this: /* ================== Scrollbars ================== */
/*
* Always show the scrollbar to allocate the space.
* Safari will respect this only if in the OS X settings the user
* has selected "Show scroll bars: Always"
*/
html {
overflow-y: scroll;
}
/*
* Chrome, Edge and firefox will support this and when it overflows
* the gutter will be stable
* https://caniuse.com/mdn-css_properties_scrollbar-gutter
*/
@supports (scrollbar-gutter: stable) {
html {
overflow-y: auto;
scrollbar-gutter: stable;
}
}
/*
* Chrome and Edge will support this and when it overflows
* the gutter will be auto and the scroll bar will be an overlay
* https://caniuse.com/css-overflow-overlay
*/
@supports (overflow-y: overlay) {
html {
overflow-y: overlay;
scrollbar-gutter: auto;
}
} The issue with this is that when a Do you have any suggestions? (We also have a mui-x license but I think it doesn't apply here) |
Summary 💡
Add
scrollContainer
to support custom scroll lock containers.Examples 🌈
Our product is a browser plugin that enables some features on social platforms. We have implemented some features on Twitter and used dialog. But since twitter implements overflow on the
html
node.Motivation 🔦
However,
scrollLock
currently only works on the body node. And developers cannot customize the nodes that require scroll lock.So I implemented a simple patch.
The text was updated successfully, but these errors were encountered: