rommguy / react-custom-scroll

Easily customize the browser scroll bar with native OS scroll behavior
MIT License
554 stars 66 forks source link

Always show scrollbar #88

Open vitaliemiron opened 4 years ago

vitaliemiron commented 4 years ago

Hi, is there any method to do scrollbar always visible ? (not only on hovering with mouse for macOs)

rommguy commented 4 years ago

Hi, sure, no problem - You can override the css class rcs-custom-scrollbar with opacity:1 and the scrollbar will be visible always. Notice that it appears above your content if your margin is too small. This is different from the native scrollbar that pushes the content to the side in some operating systems (like windows)

rommguy commented 4 years ago

@vitaliemiron please let me know if it worked

vitaliemiron commented 4 years ago

@vitaliemiron please let me know if it worked

Yes, that worked, thank you! Could you add param in js because exists some UX cases when scroll should be visible.

rommguy commented 4 years ago

Glad to hear. About js param - sure, but I don't have a lot of free time for this open source, and there are other issues to solve before this. If you can create a pull request with this change it would be great.

In the meantime, you can wrap this component with your own component that get the relevant react prop and sets the correct css according to that prop.

promet99 commented 3 years ago

@rommguy Hi, if this issue is still open and relevant, I can create a PR

rommguy commented 3 years ago

Sure @promet99 , no problem

promet99 commented 3 years ago

I just started working on the code, and would like to point out that "opacity: 1;" had to be set for both .rcs-custom-scroll and .rcs-custom-scrollbar to work, as below, at least on my local. I wonder how @vitaliemiron solved it tho.

.rcs-custom-scroll .rcs-custom-scrollbar {
    opacity: 1;
}
promet99 commented 3 years ago

@rommguy Hey I made a PR #103

promet99 commented 3 years ago

@rommguy Ping!