svelte-virtual-list icon indicating copy to clipboard operation
svelte-virtual-list copied to clipboard

Viewport goes empty if scrolled down and items array changes.

Open kevmodrome opened this issue 5 years ago • 1 comments

So I decided to try to work with this component and add a filteredItems function that filters depending on some input.

It appears as though the viewport is not scrolled to the top when the items array changes which results in some weird behaviour. I have showcased it in this REPL

To reproduce, scroll down some hundreds of items and start writing something in the input field.

The solution is simple and I will make a PR.

kevmodrome avatar Oct 06 '19 19:10 kevmodrome

I mucked about some and saw that a change to items was running refresh but relying on stale info, so I made the change to items reset start and end if they are now out of range. There may be some duplicate calls going on, but as a quick and dirty it seems to work:

REPL

jdevine avatar Jan 17 '20 15:01 jdevine