Skip to content

Conversation

arminmeh
Copy link
Contributor

@arminmeh arminmeh commented Sep 26, 2025

Reproduction steps

1 .Go to https://mui.com/x/react-data-grid/charts-integration/#row-grouping
2. Click on "Reset demo" button

On re-render, active chart id is not in the state in the cycle where the targeted row depth is being calculated, making the hook skip collecting the data for one level of the rows.

Preview https://deploy-preview-19720--material-ui-x.netlify.app/x/react-data-grid/charts-integration/#row-grouping

@arminmeh arminmeh requested a review from a team September 26, 2025 10:00
@arminmeh arminmeh added type: bug It doesn't behave as expected. scope: data grid Changes related to the data grid. labels Sep 26, 2025
@mui-bot
Copy link

mui-bot commented Sep 26, 2025

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

Bundle size report

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 🔺+14B(0.00%) ▼-1B(0.00%)
@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 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 84290f2

Copy link
Member

Choose a reason for hiding this comment

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

On re-render, active chart id is not in the state in

How come this is not an issue on initial mount?

Copy link
Contributor Author

@arminmeh arminmeh Sep 29, 2025

Choose a reason for hiding this comment

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

Found the answer.

On initial mount, filteredRowsSet and sortedRowsSet events come after the visibleDimensions reference is set, so the calculation runs fine.
On reset (key change), the events come before the visibleDimensions is set, and the chart integration hook falls back to set categories on the top level of the rows.

The changes in this PR make it run correctly regardless of the order of the events.

@arminmeh arminmeh changed the title [DataGridPremium] Keep active chart id reference up to date [DataGridPremium] Get correct active chart id while rebuilding data Sep 26, 2025
@arminmeh arminmeh added the plan: Premium Impact at least one Premium user. label Sep 26, 2025
@arminmeh arminmeh merged commit d3c0b88 into mui:master Sep 29, 2025
21 checks passed
@arminmeh arminmeh deleted the active-chart-id-ref branch September 29, 2025 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plan: Premium Impact at least one Premium user. scope: data grid Changes related to the data grid. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants