Broken scroll with permanentTrackY
Hi! Thanx for you plugin it's realy good one! But i found some strange behavior. I've made a wrapper component for Scrollbar to pass all nesessary stuff
const Scroller = ({children, inverted}) => (
<Scrollbar
permanentTrackY
children={children}
renderer={({elementRef, ...props}) => (
<div {...props} ref={elementRef} className={CN}/>
)}
wrapperProps={{
renderer: ({elementRef, ...props}) => (
<div {...props} ref={elementRef} className={cn(CLASSES.WRAP, {inverted})}/>
)
}} />
)
and use it in my layout component
const LayoutRightSidebar = ({title, action, children, sidebar}) => (
<div className={CN}>
<section className={`${CN}__container`}>
<div className={`${CN}__body`}>
<Scroller>
<ContentBlock title={title} action={action}>
{children}
</ContentBlock>
</Scroller>
</div>
<aside className={`${CN}__side`}>
<Scroller>
{sidebar}
</Scroller>
</aside>
</section>
</div>
);
When i'm loading a page with this layout scrollbars act randomely. It could be working a sidebar but content not, sometimes nothing is working at all. On each refresh you've got random result.
PS if permanentTrackY is disabled - everything is perfect
Hm. I'll take a look when return from vacation.
Also running into issues when enabling permanentTrackY to true. Although my problem might be totally unrelated to OP's problem as I am having problems with react-measure and toggling "display: none" on a parent element. Basically the element comes back with overflow: hidden; set which prevents the mousewheel scrolling. Really hard to give an example but hopefully OP has a working example which would also fix my issue.
I have a feed component with the permanentTrackY. And if there's no messages initially, after I add a batch of them, the scroll doesn't work. I need to click on the scrollbar once, to awake it.
Without permanentTrackY it works fine. If the component initially rendered with scroll it also works fine.
@DZakh that is a great hint, thank you. ill try to investigate some time later.
I am having a similar issue with permanentTrackY set to true. For me the scrollbar is only responding when dragged manually with the mouse after permanentTrackY=false. With permanentTrackY=true it is responding to scrollwheel event like expected...