-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Conversation
Deploy preview: https://deploy-preview-16639--material-ui-x.netlify.app/ |
@@ -745,7 +745,9 @@ describe('<DataGrid /> - Rows', () => { | |||
width={100} | |||
/>, | |||
); | |||
expect($$(`.${gridClasses.cell}:not(.${gridClasses.cellEmpty})`)).to.have.length(2); | |||
await waitFor(() => { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
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 🤷
Cherry-pick PRs will be created targeting branches: v7.x |
See reproduction steps in #16628 to try the fix locally.
Before
After
Fixes #16628