List not showing enough elements when big differences in height
See original GitHub issueThis is a bit of a special and maybe even contrived case, at least to the extent I did it, but this could lead to mistakes in more reasonable examples aswell.
Virtuoso doesn’t really handle big differences in height very well, when there is a sudden decrease in size.
<Virtuoso style={{ width: '100%', height: '400px' }} overscan={400} totalCount={200} item={(index: number) => {
return <div style={{height: (index < 100 ? 200 : 20)}}>test {index}</div>;
}} />
Since the first 100 items have a height of 200 Virtuoso assumes that height for all elements to begin with and once you scroll down to the items with a height of 20 it does not render enough items to fill the viewport.
I’m not sure if I’m doing something wrong or this is simply a limitation of the list.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Making the height of list items in a row follow their largest height
You can see the book in the center needs more height space than the other two books in the same row because its...
Read more >Sizing items in CSS - Learn web development | MDN
Understanding how big the different features in your design will be is important. So, in this lesson we will summarize the various ways...
Read more >Index and View Tall Array Elements - MATLAB & Simulink
Index and View Tall Array Elements. Tall arrays are too large to fit in memory, so it is common to view subsets of...
Read more >Make Windows easier to see - Microsoft Support
Learn how to make your Windows display easier to see using accessibility features ... If there's not enough contrast between the elements on...
Read more >.height() | jQuery API Documentation
The value reported by .height() is not guaranteed to be accurate when the element or its parent is hidden. To get an accurate...
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 Free
Top 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

Got it, thanks for the repro steps!
Published 0.12.4 and updated the example with it. You can see how the shorter items are re-filled with new ones.
A property that can improve the behavior in this case is
defaultItemHeight- something which I consider.