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] Use true content height to dispatch rowsScrollEnd #2938

Merged
merged 1 commit into from
Oct 22, 2021

Conversation

m4theushw
Copy link
Member

@m4theushw m4theushw commented Oct 21, 2021

Preview: https://deploy-preview-2938--material-ui-x.netlify.app/components/data-grid/rows/#infinite-loading

On https://next--material-ui-x.netlify.app/components/data-grid/rows/#infinite-loading:

yQvTmjIk7t

The infinite loading stops at 40 rows. This happens because it was using containerSizes.dataContainerSizes.height which is not the same height used by the virtualization.

@m4theushw m4theushw added bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! labels Oct 21, 2021
@m4theushw m4theushw self-assigned this Oct 21, 2021
),
});
virtualScroller.scrollTop = 12345;
virtualScroller.dispatchEvent(new Event('scroll'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one. Yes the first time it does fire but the times are the first one it fails.


const rowsInCurrentPage = React.useMemo(() => {
if (props.pagination && props.paginationMode === 'client') {
const start = paginationState.pageSize * paginationState.page;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need the pagination here? The infinite loader should only work when there is no pagination.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it could be removed. I only wanted to use the same height used by the virtualization so I copied the code from there. I'll fix this later.

@m4theushw m4theushw merged commit 4ca58fd into mui:next Oct 22, 2021
@m4theushw m4theushw deleted the infinite-loading branch October 22, 2021 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants