Using an external library to handle the styling of the scrollbars probably wraps your content in a div and causes position: sticky
to stop working.
Probably your best bet is to try to style the scrollbars in the ScrollablePane
directly. Something like:
const sbWidth = 6;
const sbHeight = 6;
const sbBg = "pink";
const sbThumbBg = "red";
<ScrollablePane
styles={{
root: {
selectors: {
// Firefox
".ms-ScrollablePane--contentContainer": {
scrollbarWidth: sbWidth,
scrollbarColor: `${sbThumbBg} ${sbBg}`
},
// Chrome, Edge, etc
".ms-ScrollablePane--contentContainer::-webkit-scrollbar": {
width: sbWidth,
height: sbHeight
},
".ms-ScrollablePane--contentContainer::-webkit-scrollbar-track": {
background: sbBg
},
".ms-ScrollablePane--contentContainer::-webkit-scrollbar-thumb": {
background: sbThumbBg
}
}
}
}}
>
You can of course add more customizations.
Didn't test on Firefox but should work.
CodeSanbox: https://codesandbox.io/s/fluet-ui-custom-scrollbars-ygm07?file=/src/index.tsx
Styling scrollbars: https://css-tricks.com/the-current-state-of-styling-scrollbars/
