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

Unnecessary item creation / destruction #29

Closed
inzanez opened this issue Sep 23, 2023 · 1 comment
Closed

Unnecessary item creation / destruction #29

inzanez opened this issue Sep 23, 2023 · 1 comment

Comments

@inzanez
Copy link

inzanez commented Sep 23, 2023

Hi

I have an image viewer that might display thousands of images, and the user can zoom into the images using the mouse-wheel and the 'control' key. I noticed that if the list is large and the current position is not somewhere at the beginning (like the first 100 items? not sure where the limit is), items that are on screen are being rerendered when zooming.

To see what I mean:

https://svelte.dev/repl/69d2cb5333304d29a661c40b2d5808d0?version=4.2.1

If you press 'Ctrl' and scroll while at the beginning of the list, the time of the items do not update. If you scroll down 50% into the list and do the same, the time updates with every "zoom tick". And the time only updates if 'onMount' is called in the rendered Item...why is that? That should not be I think, should it?

@inzanez inzanez changed the title Unnecessary re-renders in large lists Unnecessary item creation / destruction Sep 23, 2023
@inzanez
Copy link
Author

inzanez commented Sep 23, 2023

Never mind, my mistake...the await tick(); was actually incorrect.

@inzanez inzanez closed this as completed Sep 23, 2023
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

No branches or pull requests

1 participant