-
Notifications
You must be signed in to change notification settings - Fork 7
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
Problem with window position jumping when adding new data #2
Comments
https://svelte.dev/repl/66310de6bb4f474e9fc2cf8ceef30cc5?version=3.24.1 steps to reproduce:
It will cause window position to jump way up, instead of staying in same place. |
hmmm I added a way to refresh the grid calculations. I modified your code a bit (just playing around with picsum!) and I tied an image's Another limitation to the algorithm is it doesn't seem to do a good job of balancing items when they wildly vary in size, but I think that's a much harder issue to solve. Here's my REPL test: https://svelte.dev/repl/2c5a8e5ae579471ea22b3f5561268d11?version=3.24.1 Thanks for calling these few out! I was planning on using this for infinite loading as well, so I was going to run into these bugs eventually 👍 |
One of proposed solutions, somewhere on stackoverflow was to add Here's the |
oh that's a clever solution! I'll try to implement it! I might also consider a debounce function but that's a more heavy-handed solution |
It's only been 3 years (sorry...), but I've bumped the version to Sveltekit and created a new working demo here, with async: https://svelte-masonry-one.vercel.app/ Please report new/existing bugs in a new issue! |
I'm implementing infinity scroll and this repo masonry.
The problem is that when masonry is re-initiated after new data being loaded,
the window looses its position and jumps up.
I'll try to make a example on repl.
The text was updated successfully, but these errors were encountered: