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

Overscan in px, instead of # of items #378

Open
aeharding opened this issue Feb 15, 2024 · 2 comments
Open

Overscan in px, instead of # of items #378

aeharding opened this issue Feb 15, 2024 · 2 comments

Comments

@aeharding
Copy link
Contributor

aeharding commented Feb 15, 2024

Is your feature request related to a problem? Please describe.

In my application, I find myself tweaking overscan depending on item height. I believe that overscan being the # of items to load off screen is limiting in the following ways:

  1. For shorter items, I need a larger overscan so that they don't flicker in as the user outscrolls the render. For very tall items, I need a short overscan.
  2. For VERY large tall items, if I set overscan = 0 I still see a flicker of the item being rendered when I scroll to the next item. So, I set overscan = 1. This works, however when I am very far away from the end of the item, it doesn't make sense to load in the next time until I get closer to the edge.

Describe the solution you'd like

Overscan = px of items to load off screen.

For example, if overscan = 500, then Virtua will load at least 500px of items off the edge of the screen.

This resolves both of my above scenarios.

Describe alternatives you've considered

Adjusting overscan for item size works for problem one but not two.

Additional context

react-virtuoso has this, except it's called increaseViewportBy.

See: https://virtuoso.dev/virtuoso-api-reference/


This may render #298 unnecessary, since if it was defined it could just be a static number like 200 px or something.

@inokawa
Copy link
Owner

inokawa commented Feb 15, 2024

Hi, overscan with px sounds nice!

@inokawa inokawa self-assigned this Feb 15, 2024
@inokawa inokawa removed their assignment Oct 12, 2024
@inokawa
Copy link
Owner

inokawa commented Oct 14, 2024

mui/mui-x#11344

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