KingSora / OverlayScrollbars

A javascript scrollbar plugin that hides the native scrollbars, provides custom styleable overlay scrollbars, and preserves the native functionality and feel.
https://kingsora.github.io/OverlayScrollbars
MIT License
3.71k stars 215 forks source link

Can I safely set `z-index: auto` to `[data-overlayscrollbars-viewport]` element? #647

Closed hatttfu closed 1 month ago

hatttfu commented 1 month ago

Firstly, thank you for this beautiful library!

Describe the bug I have some fixed block with z-index: 10 and with scrollable content inside. Also I've got one more fixed element inside this scrollable content, which overlapping by scrollbar. It can be solved by setting z-index: auto to [data-overlayscrollbars-viewport] element, but I'm not sure it doesn't have any unintended consenquences.

Examples https://codesandbox.io/p/devbox/overlayscrollbars-vue-example-forked-d4jljx?file=%2Fsrc%2FApp.css%3A11%2C19

To Reproduce Steps to reproduce the behavior:

  1. Go to block and scroll down
  2. See block being overlapped by scrollbar
KingSora commented 1 month ago

Good day @hatttfu :)

Changing z-index should be purely cosmetic change and if it works for your usecase there shouldn't speak anything against it