Skip to content

Large set of data not fully rendered #460

Closed as not planned
Closed as not planned

Description

@AXeL-dev

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.

Activity

  1. jcready commented on Jan 1, 2023

    @jcready

    The react-virtualized library works around this issue by scaling the the scroll position it sets for a row based on the ratio of "max CSS height allowed by browser" to "computed height of all rows" if the latter is greater than the former: https://github.com/bvaughn/react-virtualized/blob/master/source/Grid/utils/ScalingCellSizeAndPositionManager.js

  2. spandzgit commented on Jan 26, 2023

    @spandzgit

    We are also facing the same issue in our application where we are using react-virtual to render millions of rows. We have implemented a jump scroll approach which allows us to drag the scroll to any position and render the corresponding records. Essentially when we drag it to the end it just renders the rows based on the max-scroll-position max-limit of the browser instead of the max lines available in the report.

    This stops us from rendering the whole report. It will really help if this issue is Prioritized to be fixed in the library to scale the scrollPosition / Offset.

  3. tannerlinsley commented on Aug 29, 2023

    @tannerlinsley
    Member

    Would love to see some links and prior art on this topic.

  4. jcready commented on Jan 15, 2024

    @jcready

    Would love to see some links and prior art on this topic.

    Is this not enough? https://github.com/bvaughn/react-virtualized/blob/master/source/Grid/utils/ScalingCellSizeAndPositionManager.js

    If the total height of all the rows is greater than the maximum allowed by the browser (this is different per browser, but a single default value of 1,500,000px can safely be used) then the scroll position needs to be a percentage of that max height, not the total height of all the rows.

  5. joodaloop commented on Mar 11, 2024

    @joodaloop

    Would love to see some links and prior art on this topic.

    Fast grid (https://github.com/gabrielpetersson/fast-grid) seems to handle many millions of rows.

  6. piecyk commented on Oct 14, 2026

    @piecyk
    Collaborator

    Consolidating: this is the browser's maximum element height limit, also tracked in #616, where #1172 proposes built-in scroll scaling. Closing in favour of #616 so the discussion stays in one place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions