-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 error logged during skeleton loading with nested data grid #14186
[DataGrid] Fix error logged during skeleton loading with nested data grid #14186
Conversation
Deploy preview: https://deploy-preview-14186--material-ui-x.netlify.app/ |
/* Hide grid rows and vertical scrollbar when skeleton overlay is visible */ | ||
[`& .${c['main--hasSkeletonLoadingOverlay']}`]: { | ||
[`& .${c.virtualScrollerContent}, & .${c['scrollbar--vertical']}, & .${c.pinnedRows}`]: { | ||
display: 'none', |
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.
I tried doing this instead:
visibility: 'hidden',
position: 'fixed',
It seems to work, but I'm unsure if this would work in every scenario.
What do you think?
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 does seem to work - I thought we tried this the other day 😅. I will do some more thorough testing to double check different scenarios.
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.
This seems to be the ideal combination here. The virtual scroller content retains it's height with visibility: hidden
, fixing the issue with nested data grid. And position: fixed
takes the element out of the flow. Will make the change, thanks @cherniavskii for taking a look.
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.
Great! 🎉
When the skeleton loader is active, we hide the data grid scroller contents and vertical scrollbar with CSS. This works well for most cases, however, causes an issue when a data grid is nested within master details. A short summary of what happens:
loading
prop gets set totrue
MUI X: useResizeContainer - The parent DOM element of the data grid has an empty height. Please make sure that this element has an intrinsic height. The grid displays with a height of 0px.
Fixes #14061