Skip to content

fix: now scrolls to top if the items array changes. - #31

Open
kevmodrome wants to merge 1 commit into
sveltejs:masterfrom
kevmodrome:master
Open

fix: now scrolls to top if the items array changes.#31
kevmodrome wants to merge 1 commit into
sveltejs:masterfrom
kevmodrome:master

Conversation

@kevmodrome

Copy link
Copy Markdown

This fixes issue #30

@gitbreaker222

Copy link
Copy Markdown

looks good to me 👍
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

@gitbreaker222

Copy link
Copy Markdown

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:
filter: removing items resets scroll to top (prevent empty viewport)
☑️ load more: adding items keeps scroll position

And this PR turns it around to:
☑️ filter: removing items resets scroll to top
load more: adding items keeps scroll position

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants