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

[datagrid] onRowsScrollEnd should trigger even if initial data row heights is less than table height #8479

Open
wants to merge 1 commit into
base: v6.x
Choose a base branch
from

Conversation

yaredtsy
Copy link
Contributor

@yaredtsy yaredtsy commented Apr 2, 2023

Fixes #4184

Problem

Currently, the onRowsScrollEnd function is not triggering if the initial data row height is less than the table height. This is because, after onRowsScrollEnd is called once, it must leave the bottom area to be called again so that it will not be fired infinitely.

solution

Set isInScrollBottomArea to false when new rows are being added, indicating that the scroll position is no longer at the bottom of the content.

before https://codesandbox.io/s/sleepy-farrell-uo38ju?file=/demo.tsx
after https://codesandbox.io/s/jovial-glitter-k9ok92?file=/demo.tsx

@mui-bot
Copy link

mui-bot commented Apr 2, 2023

Netlify deploy preview

Netlify deploy preview: https://deploy-preview-8479--material-ui-x.netlify.app/

Updated pages

No updates.

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 623.6 1,109.1 633.6 782.96 177.882
Sort 100k rows ms 628.7 1,123.5 807.9 902.42 169.477
Select 100k rows ms 246.5 394.4 269.6 288.62 53.815
Deselect 100k rows ms 136.9 277 194.5 205.06 46.059

Generated by 🚫 dangerJS against e1154c2

@yaredtsy yaredtsy changed the title [datagrid] Fixing onRowsScrollEnd to trigger even when initial data row heights is less than table height [datagrid] onRowsScrollEnd should trigger even if initial data row heights is less than table height Apr 2, 2023
@zannager zannager added the component: data grid This is the name of the generic UI component, not the React module! label Apr 3, 2023
@m4theushw
Copy link
Member

We plan to rework this event to use IntersectionObserver. It will reduce a lot of the code for the logic to check if the user is seeing the bottom of the list or not. I described a bit more the solution in #4371 (comment)

@oliviertassinari
Copy link
Member

(I have added the review request to remove the PR from https://tools-public.onrender.com/prod/pages/1t353h04)

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 20, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@MBilalShafi MBilalShafi changed the base branch from master to v6.x March 21, 2024 02:42
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! v6.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[question] onRowsScrollEnd is never fired when initial data rows height less than table height
6 participants