jonasgeiler / svelte-tiny-virtual-list

A tiny but mighty list virtualization library for Svelte, with zero dependencies 💪 Supports variable heights/widths, sticky items, scrolling to index, and more!
https://svelte-tiny-virtual-list.jonasgeiler.com
MIT License
405 stars 23 forks source link

smooth scroll when using scrollToIndex ? #16

Closed anotherempty closed 2 years ago

anotherempty commented 2 years ago

Can you add a scroll animation when using scrollToIndex ? and if possible allow an easing function to be passed as a parameter for the scrolling animation ?

jonasgeiler commented 2 years ago

This might require a few changes, but I will probably add this feature when I find the time!

jonasgeiler commented 2 years ago

Added in 2.0.5 (ce19972)! Just set scrollToBehaviour to auto (it's instant by default to maintain backwards compatibility). Passing over an easing function is unfortunately not possible.

Let me know if there's any problems!