How to add gaps to the infinite scrolling list?
I have a simple infinite scrolling list (for ease mind it just a huge one-page list) and it's just the same as the docs example https://tanstack.com/virtual/v3/docs/guide/introduction
With this useVirtualizer options
But whenever I've tried to add a gap like so:
virtual list starting increasing its offset from top of the visible List rectangle (each item I scroll than each gap of the scrolled list would be added to such offset)
It results into hiding my virtual list completely at some point when offset = visible List rectangle
(see attached screenshot)
How can I add gaps without this weird behaviour?
Introduction | TanStack Table Docs
TanStack Virtual is a headless UI utility for virtualizing long lists of elements in JS/TS, React, Vue, Svelte and Solid. It is not a component therefore does not ship with or render any markup or styles for you. While this requires a bit of markup and styles from you, you will retain 100% control over your styles, design and implementation.
T...

3 Replies
wise-whiteOP•3y ago
Well, it become possible when adding paddingTop and increasing estimateHeight
extended-salmon•3y ago
I think that the easiest way to add gaps between the items is to increase their size - to include the gaps in the items
fair-rose•3y ago
Yes, i would also include the gap in item.