React-window: Is there any way to hide horizontal scrollbar on systems/browsers with always visible scrollbar?

Created on 6 Apr 2020  路  3Comments  路  Source: bvaughn/react-window

A horizontal scrollbar indicates that there is a space below the vertical scrollbar 馃. The horizontal scroll bar is displayed always when the vertical bar is present.

I am using react-virtualized-auto-sizer package to achieve Grid width equal 100vh.

image

All 3 comments

This is a very common behavior related to the scrolling bar. I would try set overflow-x: hidden;

Looks like a duplicate of an issue I encountered some time ago https://github.com/bvaughn/react-window/issues/65

Your described behavior happens because vertical scroll bar also takes up space and it's more than your specified grid width. You'll need to take into account the OS scrollbar width and adjust your grid width accordingly.

There's a neat trick/hack to calculate scrollbar dimensions:
https://stackoverflow.com/questions/13382516/getting-scroll-bar-width-using-javascript

Thank @matthewma7 and @martynaskadisa for your answers 馃敟
I was hoping that there is some magic argument or popular solution for that type of issue 馃槂馃槙.

I think that this issue could be closed as all needed informations was provided 馃槃

Was this page helpful?
0 / 5 - 0 ratings