inokawa / virtua

A zero-config, fast and small (~3kB) virtual list (and grid) component for React, Vue, Solid and Svelte.
https://inokawa.github.io/virtua/
MIT License
1.35k stars 47 forks source link

Remove offscreen items when idle #523

Open inokawa opened 1 month ago

inokawa commented 1 month ago

This PR will change overscan behavior while not scrolling, from rendering overscaned items(like react-window, https://github.com/inokawa/virtua/issues/273#issuecomment-1837303839) to not rendering them.

Benefits:

m-a-r-c-e-l-i-n-o commented 3 days ago

Hey Inokawa

problem that remount of items on the opposite side of scrolling can cause small glitch

I've been running into an issue that I can't quite seem to pinpoint. The browser will throw a ResizeObserver error -complaining that a valid DOM element was not passed in from inside Virtua. Seems to occur only when the "reverse" option is true and when there are no items on the list or there used to be items but now the list is empty. Wondering if this is the same issue. I'm using React by the way... Thanks!

inokawa commented 3 days ago

@m-a-r-c-e-l-i-n-o I think it's not related to this. Please make an issue with a reproduction.