svelte-virtual-list
svelte-virtual-list copied to clipboard
fix: now scrolls to top if the items array changes.
This fixes issue #30
looks good to me :+1: I thought of the same solution when my playlist-repl has several 1000 songs and i filter for names while scroll position is somewhere in the middle
edit:
if I understand this correctly, refresh with the new "scrollUp" would be called if the next list length is smaller or greater. But if the list gets longer, it would (re)create another issue as described in #15
=> if we add items (lazy loading / infinite scroll) we want to keep the current scroll position
So right now we have: :negative_squared_cross_mark: filter: removing items resets scroll to top (prevent empty viewport) :ballot_box_with_check: load more: adding items keeps scroll position
And this PR turns it around to: :ballot_box_with_check: filter: removing items resets scroll to top :negative_squared_cross_mark: load more: adding items keeps scroll position