Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable show Scrollbar On Google Chrome(and Safari) which does not display scroll bars by default #34

Open
ellis-s opened this issue Aug 1, 2022 · 1 comment

Comments

@ellis-s
Copy link

ellis-s commented Aug 1, 2022

Hi, I used this react component a few days ago, It's very efficient!

But, today I find a compatibility problem. It does't work when Google Chrome is set to not show the scroll bar by default.

The cause of the problem is the getScrollbarWidth.ts file. You will get number 0 by function getScrollbarWidth when Google Chrome is set to not show the scroll bar by default. Because the value of div.offsetWidth equal to the value of div.clientWidth.

@elvinasv
Copy link

elvinasv commented Aug 24, 2022

Hi, @ellis-s, I have a similar issue.

Google Chrome is set to not show the scroll bar by default

Are you using Chrome feature flag to enable/disable scrollbar by default?
I had to set Show scroll bars to Always on macOS Monterey (v12.5) (as suggested by https://stackoverflow.com/a/22865691). Then the scrollbar started to appear where expected on all browsers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants