About autoHeight Virtual-list

Hi @nolimits4web,

I am debugging a strange bahaviour of my virtual-lists, but I need to ask another question first.
Why is [data-virtual-list-index] selector here? I can’t see any case this attribute is available. The typical structure is ul>li, So Maybe just find(‘li’)?

For now, the code always ends up to vl.heights[i] = 40; instead of enderedItem.offsetHeight.


not necessarily.

what if it’s not li, what if it’s just p? (or anything)

just add data-virtual-list-index to every item:
here => interesting-voice-eywswy - CodeSandbox

Thank you your time creating a working demo which solves my problem.

data-virtual-list-index is required for autoHeight Virtual-list to work properly. (I was facing a jumpy scrolling glitch)

However, it is not documented anywhere. If I didn’t dive into the source code, I won’t see it.