sveltejs / svelte-virtual-list

A virtual list component for Svelte apps
https://svelte.dev/repl/f78ddd84a1a540a9a40512df39ef751b
Other
689 stars 58 forks source link

Fixing problem with scrolling and small list. #24

Closed daliusd closed 2 years ago

daliusd commented 5 years ago

There is following problem:

Result:

Content is not visible because scrollbar is outside of it.\

I have tried running tests with and without fix but they fail on my machine.

daliusd commented 5 years ago

Most probably this is not really good fix but at least list always shows something.

davidglezz commented 4 years ago

I think that would be better to keep the view on the last item. (pseudocode)

viewport.scrollTo(currentX, content_height - listHeight);