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

Angular virtual dynamic measuring not working properly #843

Open
2 tasks done
JKupski opened this issue Sep 26, 2024 · 1 comment
Open
2 tasks done

Angular virtual dynamic measuring not working properly #843

JKupski opened this issue Sep 26, 2024 · 1 comment

Comments

@JKupski
Copy link

JKupski commented Sep 26, 2024

Describe the bug

I am having trouble getting a virtual scroll running properly. I have data that is very much dynamic within its size. There can be 1 or around 600000 entries that I want to display. Sadly I am having trouble getting something running properly. I forked the dynamic example from the docs.
When setting the entries to around 1000 the scroll works, but when increasing the amount of entries to 1000000 I can't scroll to the bottom and only see around 400000 entries. Playing around with the estimateSize property fixes the issue, but when scrolling the scroll behaviour is weird and jumps in big chunks.

Here is an example to show what I mean: https://stackblitz.com/edit/tanstack-virtual-pitwef?file=src%2Fapp%2Frow-virtualizer-dynamic.component.ts,src%2Fapp%2Fapp.routes.ts,src%2Fapp%2Fapp.component.ts,src%2Fapp%2Frow-virtualizer-dymaic-test.component.ts

Your minimal, reproducible example

https://stackblitz.com/edit/tanstack-virtual-pitwef?file=src%2Fapp%2Frow-virtualizer-dynamic.component.ts,src%2Fapp%2Fapp.routes.ts,src%2Fapp%2Fapp.component.ts,src%2Fapp%2Frow-virtualizer-dymaic-test.component.ts

Steps to reproduce

  1. Add a virtual-scroll container
  2. Set count to 9999 and estimateSize
  3. Change count to 999999 or more

Expected behavior

When the count of rows changes drastically, the virtual-scroll should be able to handle both cases without having to change the config programmatically.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

macOS- with Safari Browser and Chromium Browsers

tanstack-virtual version

v3.10.8

TypeScript version

Tested locally with 5.5.4 in stackblitz 5.2.2

Additional context

No response

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
@JKupski JKupski changed the title Angular virtual dynamic measuring not working right Angular virtual dynamic measuring not working properly Sep 26, 2024
@garrettld
Copy link
Contributor

garrettld commented Dec 24, 2024

Thanks for trying out Angular Virtual! The issue you're running into is a hard limit set by the browser. With 999999 items at 120px you're at a total of ~120M, which is well over Chrome's maximum of ~33M (the max differs by browser, version, etc.).

Here's the height style and the actual height that I see on my machine on your StackBlitz reproduction:

Image

Also see #460 for discussion of a workaround. If it works, it would be nice to have a workaround implemented in TanStack Virtual core, but I think it would be possible to implement in userland as well.

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