jonasgeiler / svelte-tiny-virtual-list

📚 A tiny but mighty list virtualization library for Svelte, with zero dependencies 💪 Supports variable heights/widths, sticky items, scrolling to index, and more!
https://svelte-tiny-virtual-list.jonasgeiler.com
MIT License
468 stars 25 forks source link

Using a function for sizing results in an incorrect total size once the items get all sized #26

Open dtzxporter opened 1 year ago

dtzxporter commented 1 year ago

https://github.com/skayo/svelte-tiny-virtual-list/blob/1cc31b6b919b1624c24286445367ec8bc40727cf/src/SizeAndPositionManager.js#L230

This looks like part of the issue. (if you have 50 items, and they are all measured (last = 49), this will still add estimated to the final size.

May be other issues with the function, but it works properly just passing an array and recomputing the sizes as needed.