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] Fix scrollbars overlapping cells on mount #16639

Merged
merged 4 commits into from
Feb 19, 2025

Conversation

KenanYusuf
Copy link
Member

@KenanYusuf KenanYusuf commented Feb 18, 2025

See reproduction steps in #16628 to try the fix locally.

Before

localhost_3001_playground_

After

localhost_3001_playground_ (1)

Fixes #16628

@KenanYusuf KenanYusuf added bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! regression A bug, but worse labels Feb 18, 2025
@mui-bot
Copy link

mui-bot commented Feb 18, 2025

Deploy preview: https://deploy-preview-16639--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 4a798d5

@KenanYusuf KenanYusuf added needs cherry-pick The PR should be cherry-picked to master after merge v7.x labels Feb 18, 2025
@KenanYusuf KenanYusuf marked this pull request as ready for review February 19, 2025 12:24
@KenanYusuf KenanYusuf requested a review from a team February 19, 2025 12:30
@cherniavskii cherniavskii added bug 🐛 Something doesn't work and removed bug 🐛 Something doesn't work labels Feb 19, 2025
@@ -745,7 +745,9 @@ describe('<DataGrid /> - Rows', () => {
width={100}
/>,
);
expect($$(`.${gridClasses.cell}:not(.${gridClasses.cellEmpty})`)).to.have.length(2);
await waitFor(() => {
Copy link
Member

Choose a reason for hiding this comment

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

Is waitFor necessary here? Was the test failing after applying the fix?

Copy link
Member Author

@KenanYusuf KenanYusuf Feb 19, 2025

Choose a reason for hiding this comment

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

Was the test failing after applying the fix?

Yep https://app.circleci.com/pipelines/github/mui/mui-x/82116/workflows/04046e3d-35d3-4676-93a4-de6436aca75b/jobs/467454

I didn't quite get to the root of the problem, but noticed that on first render the rowHasAutoHeight function here returns false https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/hooks/features/virtualization/useGridVirtualScroller.tsx#L882 but then corrects itself on second render.

I don't know if the waitFor is masking an issue, but no other tests failed 🤷

@cherniavskii cherniavskii merged commit 8aef758 into mui:master Feb 19, 2025
21 checks passed
Copy link

Cherry-pick PRs will be created targeting branches: v7.x

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! needs cherry-pick The PR should be cherry-picked to master after merge regression A bug, but worse v7.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[data grid] Scrollbars overlapping cells on mount
3 participants