Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed stuck at scroll location #60

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

adamrpostjr
Copy link

Fixed the issue where you're stuck in the scroll location during update of the items in the virtual list.. such as a search on the list of items

Fixed the issue where you're stuck in the scroll location during update of the items in the virtual list.. such as a search.
Tested more and fixed bug with not updateing
@webmasterkai
Copy link

I also experience this problem. I was following an example here https://svelte.dev/repl/a138b0c8579b4fc8bdde842a9d922b1f?version=3.17.1 and realized it's running a customized version of VirtualList.svelte to solve the issue. Came here and found your PR :-)

Looks like it's been a few years since this package has been updated...

VirtualList.svelte Outdated Show resolved Hide resolved
When I copied from my own code I forgot to reformat
@webmasterkai
Copy link

That was fast. I wonder, is #52 solving the same problem?

@adamrpostjr
Copy link
Author

I havnt tested myself but it looks like it may be!

@gitbreaker222
Copy link

gitbreaker222 commented Jan 23, 2022

hi @webmasterkai - I'll have a look, if our changes are crossing paths 😃 ....

edit
correction: of course these changes here are from @adamrpostjr . They eventually do the same as #31. In my PR #52 I've solved the problem in a different way: I don't scroll to top on change, but instead somehow detect, if the scroll position is below the new list length. If yes, it scrolls to the new end via the new method scrollTo(). This way it feels more stable, because you can e.g. filter without "loosing" your 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.

4 participants