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

Support for use of animate: directive #18

Closed jeremyjacob closed 1 year ago

jeremyjacob commented 2 years ago

I love the animate directive and Svelte's flip function. Is there a way to use that with the VirtualList?

jonasgeiler commented 2 years ago

I'm guessing you mean something like this:

<!-- When `list` is reordered the animation will run-->
{#each list as item, index (item)}
    <li animate:flip>{item}</li>
{/each}

And it might be possible, there's an #each-directive inside the component after all, but I don't have many hopes that it works well... I'll try it out!