Bug with scrolling with WindowScroller -> AutoSizer -> Table and a big Header
See original GitHub issueWhen Table
component is used in conjunction with WindowScroller
and AutoSizer
, there is a bug with empty space on top of the table when the user is scrolling content down. But it works fine when content is being scrolled up.
Gif: http://www.giphy.com/gifs/l4FGCdxL20UsKANgs
Here is a Plunkr to reproduce: https://plnkr.co/edit/joaaAQPJLPy26Do4tA3k
Please try to scroll down and up and you will see the empty space on the top of the page.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:22 (6 by maintainers)
Top Results From Across the Web
Bug with scrolling with WindowScroller -> AutoSizer -> Table and a ...
When Table component is used in conjunction with WindowScroller and AutoSizer , there is a bug with empty space on top of the...
Read more >React Virtualized: Table rows get cut off when autoHeight is on
I am using WindowScroller , AutoSizer , Table , and Column from React Virtualized,. In my 400 row table, about 30 rows appear...
Read more >Using React-Virtualized InfiniteLoader, Autosizer, and Table ...
The infinite loader component relies on a few different functions and a property. loadMoreRows As you are scrolling through the table, this ...
Read more >react-virtualized | Yarn - Package Manager
React components for efficiently rendering large, scrollable lists and tabular data. react, reactjs, react-component, virtual ...
Read more >Virtualize large lists with react-window - web.dev
Super large tables and lists can slow down your site's ... This improves both the rendering and scrolling performance of the list.
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
@borNfreee sure, here’s a short write-up first:
The reason why the cells are disappearing is that the overscan is not applied to top-side rows when scrolling forwards. In line defaultOverscanIndicesGetter.js:25 you can see the overscan start index is set to 0 or
startIndex
(the first visible row determined by some other code), whichever is higher. The problem is the first visible row index value is incorrect if padding is added - some rows before that are still in view, so you need to take that into account and offset theoverscanStartIndex
by the value of however many rows your padding could fit, soMath.ceil(PADDING / ROW_HEIGHT)
or something.My padding is minuscule so I ended up just subtracting 1 from
startIndex
in the aforementioned line, but you can reuse the logic for backwards scrolling and subtract theoverscanCellsCount
argument as seen in line defaultOverscanIndicesGetter.js:33 instead, so that it uses the overscan values supplied via props.This theoretically might need additional tweaking (or higher overscan values) for variable-height rows, but for fixed-height rows it works like a charm.
Guys, JFYI: I didn’t manage to fix this bug, but as a workaround - you can have two separate tables
disableHeader=true
)It works and fixes this ugly bug, but as I said still a workaround. Please seee
renderFakeTableAsAHeader
and a complete example