React-custom-scrollbars: Adding className to track (horizontal or vertical) breaks functionality

Created on 16 Mar 2017  路  3Comments  路  Source: malte-wessel/react-custom-scrollbars

Every time I try to customize the look of scroll bars, it breaks:

<Scrollbars
        renderTrackHorizontal={props => <div {...props} className="track-horizontal"/>}
        renderTrackVertical={props => <div {...props} className="track-vertical"/>}
        renderThumbHorizontal={props => <div {...props} className="thumb-horizontal"/>}
        renderThumbVertical={props => <div {...props} className="thumb-vertical"/>}
        renderView={props => <div {...props} className="view"/>}>
       .....

ThumbHorizontal/ThumbVertical are working, though

Most helpful comment

You have to add styles for that tracks. I added heght:100%; top:0; right:0; for .track-vertical and now my vertical track works as expected.

All 3 comments

Ok, I rephrase it: How to add className to TrackHorizontal and/or TrackVertical??? The code from documentation just doesn't work

<Scrollbars
        renderTrackHorizontal={props => <div {...props} className="track-horizontal"/>}
        renderTrackVertical={props => <div {...props} className="track-vertical"/>}
       .....

You have to add styles for that tracks. I added heght:100%; top:0; right:0; for .track-vertical and now my vertical track works as expected.

@kazagkazag that's it, thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

strobox picture strobox  路  4Comments

Amdingo picture Amdingo  路  4Comments

webchaz picture webchaz  路  3Comments

leofle picture leofle  路  4Comments

mhemrg picture mhemrg  路  4Comments