TanStack / TanStack/virtual

Large set of data not fully rendered

Open
#460 5 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.1k
Forks
466
Avg merge
2d 31m
Merged PRs (30d)
13

Description

Describe the bug

When trying to render a large list of items (1 million row for example) then scroll to the last item in the list, only 958.697 rows are rendered when the row height is equal to 35, if we set the row height to 50, then only 671.088 rows are rendered.

I think that this issue is related to a browser limitation (see https://stackoverflow.com/questions/16637530/whats-the-maximum-pixel-value-of-css-width-and-height-properties), still i noticed that libraries like react-virtualized doesn't have this issue, so i believe that there must be a way to fix it. May i get any more clarifications or ways to fix it? Thanks.

Your minimal, reproducible example

https://codesandbox.io/s/practical-ives-holiyy?file=/src/main.tsx

Steps to reproduce
  1. Run the sandbox
  2. Scroll to the last element in the virtualized list
Expected behavior

The last element should be 999.999 (since the rows index starts from 0).

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

Ubuntu 22.04, Chrome latest

tanstack-virtual version

V3.0.0-beta32

TypeScript version

No response

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox reproduction and compare the final rendered index for one-million-row lists at row heights of 35 and 50. Investigate the virtualization behavior around the browser's maximum scrollable height; done means scrolling reaches and renders item 999,999 consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.