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

Issue with scrolling getting stuck in infinite loop #53

Open
GimpMaster opened this issue May 29, 2024 · 1 comment
Open

Issue with scrolling getting stuck in infinite loop #53

GimpMaster opened this issue May 29, 2024 · 1 comment

Comments

@GimpMaster
Copy link

I just gave this a quick try. I have 80 items all with height of 733px. When I scroll down to item number 10, the scroll but starts studdering all over the place and gets into a lock state, CPU goes crazy high. Items are being added/removed infinitly. Have you seen this?

<VirtualList
width={'560px'}
height={Number($globalFeedRef?.getBoundingClientRect().height)}
itemCount={80}
itemSize={733}

<div slot="item" let:index>
	<div style="height: 733px; width: 100%; background-color: azure; border: 1px solid red">{index}</div>
</div>
@jonasgeiler
Copy link
Owner

I have noticed this problem myself while working on the new website. There is actually a infinite loop detection but it doesn't seem to work sometimes... I will look into this but for now the only advice I can give you is making sure the container of the infinite list has a fixed height and maybe try using flexbox around the virtual list.
I unfortunately don't remember what exactly fixed my infinite growing problem while working on the new website, but maybeee the code will help:

<VirtualList height={listHeight} itemSize={90} itemCount={list.length}>

If your problem still persists it would be great if you could recreate it in a REPL and I will look into it further: https://svelte.dev/repl

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

2 participants