WindowScroller: Compression mode renders glitchy while scrolling.
See original GitHub issueWhen using the WindowScroller
with List
and having the grid height exceed the 1.5 million pixel threshold (aka compression mode), the scrolling is glitchy. Rows appear on top of each other as well as white space at the top.
This seems to be only when using the bar arrows or the mouse wheel to scroll, not dragging the bar handle which is fine.
Also it seems to get worse the greater the height, if it’s just above the threshold it appears to work fine.
All browsers tested have this issue: Chrome, Firefox, IE 11.
https://plnkr.co/oskmhXrKvQ9foB2gVQDq
Code (from the plnkr):
var WindowScroller = ReactVirtualized.WindowScroller;
var List = ReactVirtualized.List;
// Enough rows to comfortably exceed the 1.5 million pixels threshold
// If it's just above this then it seems to work fine
var totalRowCount = 100000;
var rowHeight = 30;
// Render your list
// (The initial render looks good, but breaks when scrolling)
ReactDOM.render(
<WindowScroller>
{({ height, isScrolling, scrollTop }) => (
<List
autoHeight
className='List'
width={300}
height={height}
rowCount={totalRowCount}
rowHeight={rowHeight}
scrollTop={scrollTop}
rowRenderer={
({ index, isScrolling, key, style }) => (
<div
className='Row'
key={key}
style={style}
>
{"Item " + index}
</div>
)
}
/>
)}
</WindowScroller>,
document.getElementById('example')
);
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
List Virtualization - Patterns.dev
It's a windowing library by Brian Vaughn that renders only the items currently visible in a list (within a scrolling "viewport"). This means...
Read more >react-virtualized WindowScroller performance issues
I think this has to do with React setState() calls. WindowScroller listens to scroll events for the window object.
Read more >Building Carousel, Part III: Drawing Images on Screen - Dropbox
Dealing with tens of thousands of images while rendering at 60 ... rendering big thumbnails would be too slow when the user scrolls...
Read more >Troubleshooting React Virtuoso
This is more of an art than science in some use cases, especially when it comes to reverse scrolling. Certain content factors like...
Read more >Create a performant virtual scrolling list in Vue.js
In v-for mode, the data provided to the list is referenced inside the memory. Therefore, when the data changes, list items are re-rendered...
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
I ran into a similar problem trying to implement custom scrollbars on a
Grid
component. I was able to fix it by forcing theisScrolling
prop onGrid
totrue
when height exceeds 1.5m pixels. I’m not entirely sure of the performance implications, but it seemed to work for now.It looks like it works in this case as well, see: https://plnkr.co/edit/D5DWaaIkIzuVT7Id4oyI
In an effort to help find a less hacky solution, I found that a setting in my custom scrollbar implementation also fixed the problem (setting
renderByPixels
tofalse
in https://github.com/idiotWu/react-smooth-scrollbar). Perhaps this may be a clue as to what is causing the problem withWindowScroller
?Hi! I am having the same problem with
Table
andWindowScroller
. The behavior is, however strange: when I scroll down and reach the bottom of the header row (almost), The first one or two rows are not visible anymore. If I scroll up, they become visible until I scroll down again.While I was trying to take a screenshot to show you, I resized the browser’s width and seen that the rows do not hide on scrolling anymore. Could you guide me through debugging this please? Is it on my end or is this a problem here? Thanks!