Skip to content

[virtualizer] Fix initial scrollbar size calculation #22729

Draft
arminmeh wants to merge 7 commits into
mui:masterfrom
arminmeh:scrollbar-measurement
Draft

[virtualizer] Fix initial scrollbar size calculation #22729
arminmeh wants to merge 7 commits into
mui:masterfrom
arminmeh:scrollbar-measurement

Conversation

@arminmeh

Copy link
Copy Markdown
Contributor

In certain scenarios, the measured initial size was different than the first observed size, retrieved through entry of ResizeObserver, because offsetWidth - clientWidth for a non-scrolling element includes its border.

measureContentBoxSize helper tries to match that.

Additionally, the directSize shortcut is only applied to the elements that have overflow styles.

@arminmeh arminmeh added type: bug It doesn't behave as expected. internal Behind-the-scenes enhancement. Formerly called “core”. labels Jun 10, 2026
@code-infra-dashboard

code-infra-dashboard Bot commented Jun 10, 2026

Copy link
Copy Markdown

Deploy preview

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

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 🔺+444B(+0.11%) 🔺+129B(+0.11%)
@mui/x-data-grid-pro 🔺+444B(+0.08%) 🔺+130B(+0.08%)
@mui/x-data-grid-premium 🔺+444B(+0.06%) 🔺+150B(+0.07%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 🔺+442B(+0.37%) 🔺+118B(+0.32%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Behind-the-scenes enhancement. Formerly called “core”. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant