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 49 forks source link

Inject scrollRef into VList #445

Closed tanshio closed 6 months ago

tanshio commented 6 months ago

https://github.com/inokawa/virtua/issues/444

Currently, in VLlist, we can obtain the viewport size but there is no method to get the size of the scrollbar. Therefore, I have modified it to allow injecting scrollRef to use ResizeObserver to obtain the size of the scrollbar.

screencast

https://github.com/inokawa/virtua/assets/6832636/adf85dc8-c6b7-4968-bca2-373abf8d3d79