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

Large set of data not fully rendered #460

Open
2 tasks done
AXeL-dev opened this issue Dec 31, 2022 · 5 comments
Open
2 tasks done

Large set of data not fully rendered #460

AXeL-dev opened this issue Dec 31, 2022 · 5 comments

Comments

@AXeL-dev
Copy link

AXeL-dev commented Dec 31, 2022

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.
@jcready
Copy link

jcready commented Jan 1, 2023

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

@spandzgit
Copy link

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.

@tannerlinsley
Copy link
Collaborator

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

@jcready
Copy link

jcready commented Jan 15, 2024

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.

@joodaloop
Copy link

joodaloop commented Mar 11, 2024

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.

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

5 participants