how to controll the scroll outside the list
See original GitHub issueHi, recently I use react-window in my project, it works perfect if the scroll event is listened by the List self, but if I wrapped the List with div/Tab, how to hide the list’s scrollbar and make the parent div to take control of scrolling? The main part of the code is like this:
<div ref={outerRef} style={{overflow:'auto',height:'200px'}} onScroll={scrollCheck}>
<Tab
defaultActiveKey='tab1'
onChange={(key)=>{ console.log("onChange====",key)}}
>
<Tab.TabPane tab="hot" tabKey="tab1" >
<FixedSizeList
className={'demo'}
height={200}
itemSize={40}
itemData={itemData}
width={300}
outerRef={outerRef}
/>
</Tab.TabPane>
<Tab.TabPane tab="newest" tabKey="tab2" >
<div style={{background: '#368AD9', color: '#fff', padding: '15px' }}>
2...
</div>
</Tab.TabPane>
</Tab>
</div>
the render effect is like this, now I have two scrollbars
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How to disable scrolling in outer elements? - Stack Overflow
This allows you to scroll a list within an outer list, or you can change the outer list to the document to do...
Read more >Prevent Scroll On Scrollable Elements [JS & CSS] - Alvaro Trigo
1. Cancelling scroll using JavaScript ... One of the options is to listen to the wheel event on the element you want to...
Read more >Prevent Scroll Chaining With Overscroll Behavior
How to prevent scroll chaining with overscroll-behavior property in CSS.
Read more >How to fight the <body> scroll. First of all - Medium
Oh! That's super easy — style="overflow:hidden" on body. overflow:hidden will remove the scrollbars (they are hidden), and block the scroll, as long this ......
Read more >How to disable scrolling temporarily using JavaScript
In this method, a new CSS class is created where the height is set to 100%, and the scroll bar is disabled by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can use WindowScroller component from react-virtualized: https://codesandbox.io/s/vy620pkzzy
https://github.com/bvaughn/react-window/issues/30
I would love to see an example of something like WindowScroller in react-window. I attempted to do something with the scroll listener on the parent, but I ended up with a mess.
I guess I am mostly commenting to follow in the case that someone out there has got this to work with react-window and is willing to share a codesandbox or something.