buzinas / simple-scrollbar

Very simple and lightweight vanilla javascript library for creating a custom scrollbar cross-browser.
MIT License
575 stars 159 forks source link

"Mouse-wheeling" does not work on fixed positioned elements #26

Open rowild opened 7 years ago

rowild commented 7 years ago

In my case, I have some fixed-positioned elements. I put the "ss-containter" on the body tag. Once the fixed elements come into view, the scroller does not work anymore, when the mousewheel is used. And if the first element in the document flow is fixed, then scrolling is just not possible... (mac OS 10.12.6, Chrome 61)

EDIT: It seems that - at least on Chrome - the issue can be handled by setting

div {
    position: fixed;
    pointer-events: none
}

on fixed elements. That, of course, also means that all elements within the fixed element, that require some sort of mouse/cursor interaction, need a

div {
    position: relative;
    pointer-events: all
}

assigned again. Seems to work since IE 10, but needs to be confirmed.