React-custom-scrollbars: How to disable the horizontal scrollbar?

Created on 19 Dec 2017  路  5Comments  路  Source: malte-wessel/react-custom-scrollbars

Most helpful comment

@ryan-ds17 I believe this just hides the scrollbar but still enables scrolling for that direction. Is there a way to just totally ignore horizontal or vertical scrolling?

Would be nice if there was a prop like disableHorizontalScrolling and disableVerticalScrolling

All 5 comments

Add this to the scrollbar props
renderTrackHorizontal={props => <div {...props} style={{display: 'none'}} className="track-horizontal"/>}

@ryan-ds17 I believe this just hides the scrollbar but still enables scrolling for that direction. Is there a way to just totally ignore horizontal or vertical scrolling?

Would be nice if there was a prop like disableHorizontalScrolling and disableVerticalScrolling

usually if the horizontal bar is appearing is because the inner content wrapper does not have overflow: hidden. Try that to see if solves

In addition to @creativelikeadog 's answer ->

renderView={props => (
    <div {...props} style={{ ...props.style, overflowX: 'hidden' }} />
)}

I had to set overflow-x of the content wrapper to hidden.

@pawelangelow If there's a autoHeight flag, the height of renderView need to be handled seperately.

@malte-wessel What about providing a separate flag for this feature?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

umer4ik picture umer4ik  路  4Comments

Niryo picture Niryo  路  3Comments

philcockfield picture philcockfield  路  3Comments

simonkberg picture simonkberg  路  3Comments

mhemrg picture mhemrg  路  4Comments