Skip to content
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

OverlayScrollbars CSS breaks natural stacking order of elements #240

Closed
mallison opened this issue Jul 14, 2020 · 2 comments
Closed

OverlayScrollbars CSS breaks natural stacking order of elements #240

mallison opened this issue Jul 14, 2020 · 2 comments

Comments

@mallison
Copy link

Describe the bug

If I replace an element with OverlayScrollbarsComponent then elements after it that would normally layer over the scrollable area are obscured by it.

Expected behavior
Replacing an element with OverlayScrollbarsComponent would not break the natural layering order of elements.

Examples
https://codesandbox.io/s/nice-dew-ymfx7?file=/src/App.js

You can see the text scrolls over the fixed header rather than under it as it does with OverlayScrollbarsComponent replaced with a plain div.

Environment

  • Used Operating System(s): macOS 10.14.16
  • Used Browser(s) (with version): Chrome 83.0.4103.116 Safari 13.1.1

Additional context
In the Chrome dev tools I disabled the z-index: 1 rules in OverlayScrollbars.css. It fixed the layering issue but I'm not sure if there are consequences. For now, I've added explicit z index rules to various components in my app to fix.

@KingSora
Copy link
Owner

KingSora commented Jul 14, 2020

Hey!

You're right, thanks for pointing that out. Really helpful!
As a workaround you can simply add this rule:

.os-host, 
.os-host-textarea {
  z-index: 0;
}

@KingSora
Copy link
Owner

KingSora commented Aug 2, 2020

Implemented in v1.13.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants