TanStack / virtual

🤖 Headless UI for Virtualizing Large Element Lists in JS/TS, React, Solid, Vue and Svelte
https://tanstack.com/virtual
MIT License
5.38k stars 291 forks source link

Total size is calculated incorrectly for masonry grids #665

Open yekta opened 7 months ago

yekta commented 7 months ago

Describe the bug

I'm using @tanstack/svelte-virtual. With masonry type grids total size (.getTotalSize()) seems to be based on all other row heights + the height of the shortest item in the last row of the grid (instead tallest item in the latest row of the grid).

Expected behavior

For masonry type grids .getTotalSize() being calculated based on tallest item in each row instead of shortest item for the very last row.

Platform

macOS, Chrome

tanstack-virtual version

v3.0.4

Terms & Code of Conduct

davx1992 commented 4 months ago

Think it is fixed already in February. Installed latest version, and it is working correctly.