React-custom-scrollbars: Proposal: Show Scrollbar on hover

Created on 29 Feb 2016  路  8Comments  路  Source: malte-wessel/react-custom-scrollbars

Hey,

I would like to propose that there could be an option to show the scrollbar when you hover over the container.
That would be really amazing for an upcoming version! Also thanks a lot for the cool component!!

Cheers

enhancement

Most helpful comment

This .track class is never set.

All 8 comments

This can be done via css.

Let's say I have a component setup like this:

<Scrollbars
    className="custom-scrollbars">

    {this.props.children}

</Scrollbars>

You can setup the cssto be something along the lines of:

.custom-scrollbars .track{
    opacity: 0
    transition: opacity 200ms ease
}

.custom-scrollbars:hover .track{
    opacity: 1
}

Thx @envex .Closing this for now...

No problem!

This .track class is never set.

.track class is never set, how to display the track on hover ?

.track class is never set. Its not possible to style the trackbar.

This .track class is never set.

.track class is for prop renderTrackVertical

```
renderTrackVertical = ({ style, ...props }) => {
return (
className='track'
{...props}
/>
)
}

className="custom-scrollbars"
renderTrackVertical={this.renderTrackVertical}
>
{this.props.children}


```

This should do the trick

.custom-scrollbars > div:last-child {
opacity: 0;
transition: opacity 200ms ease;
}

.custom-scrollbars:hover > div:last-child {
opacity: 1;
}

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Niryo picture Niryo  路  3Comments

anupmishra203 picture anupmishra203  路  3Comments

danmo picture danmo  路  4Comments

leofle picture leofle  路  4Comments

webchaz picture webchaz  路  3Comments