estimatedItemSize - details
inzanez opened this issue · 4 comments
Hi
first of all, many thanks for that great component! :-) Works really nice and smooth.
I do have a question about the 'estimateItemSize' though:
I was under the impression that this was used to calculate the total scroll-height. So,...that it should basically match itemCount * itemSize
in case of equal height items.
If that's right, I also thought that this would prevent that growing scrollbar during scrolling. It seems that as items are being recomputed, my scrollbar grows. So I tried to use estimatedItemSize
as described above. But that gives me another weird behavior (scrolling to the bottom after a few initial correctly scrolled items). So maybe I got that totally wrong,...:-)
In all honesty, I'm not actually sure what this property does.
I've looked at both, my source code and the originaly react-tiny-virtual-list
source code, and it's only used for calculation in getTotalSize
. Although as soon as totalSize
is set, this property is used instead and estimatedItemSize
doesn't affect anything...
My guess is, it helps with initial rendering and reducing content shift, but other than that, I'm very sorry... Can't really help you.
You could try to open an issue here, but it doesn't seem to be actively maintained...
Not to worry, I think I'll try to dig into this...:-)
Any updates on this? I'd like to close this issue.
Let me know if you need any help!
Of course,...I haven't found what exactly it does, so....I am ignoring it for now ;-)