-
-
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
[data grid] Fix choppy overlay resizing #16367
base: master
Are you sure you want to change the base?
Conversation
Deploy preview: https://deploy-preview-16367--material-ui-x.netlify.app/ |
Co-authored-by: Kenan Yusuf <[email protected]> Signed-off-by: Lauri <[email protected]>
Co-authored-by: Kenan Yusuf <[email protected]> Signed-off-by: Lauri <[email protected]>
height: Math.max( | ||
0, | ||
viewportOuterSize.height - | ||
topContainerHeight - | ||
bottomContainerHeight - | ||
(hasScrollX ? scrollbarSize : 0), | ||
), |
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.
For this PR and the other one, we need to document (breaking) changes to viewportInnerSize
in https://github.com/mui/mui-x/blob/master/docs/data/migration/migration-data-grid-v7/migration-data-grid-v7.md
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 the plan to keep autoHeight
around for the v8, given that it's already deprecated in v7?
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.
It's not confirmed, but it's likely autoHeight
will still be available in v8.
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.
We might undeprecate that prop if the new alternative's issues can't be worked out.
Fixes choppy overlay resizing.
Currently, overlays depend on widths passed as style based on DOM measurements. This is not necessary though, and since updating dimensions is throttled, it can make overlays appear choppy when the viewport is resized.
Normally, this is not a problem, but with overlays it is:
Best demo to test it on:
https://next.mui.com/x/react-data-grid/overlays/#custom-component
You see the centred content moving with a delay, and especially at breakpoints (but also when resizing fast or with an animation) you get a flash of the underlying content.
The issue:
before-choppy.mp4
After:
after-no-chop.mp4