Skip to content

Conversation

MBilalShafi
Copy link
Member

@MBilalShafi MBilalShafi commented Aug 1, 2025

Fixes #19001

Before: https://stackblitz.com/edit/ddumkzun-fz2hksdw
After: https://stackblitz.com/edit/ddumkzun-iv8mn7xq

Changes done

This PR fix two things:

  1. When the package is Pro or Premium but no nested data is available, row selection propagation was still running unnecessarily.
  2. A redundant sibling search was occurring at the root level, even though it was already handled by the select all cell component.

Follow up

A part of the performance issue still remains in this line:

return parentNode.children.filter((childId) => childId !== id && filteredRows[childId] !== false);

Specifically, the .filter() operation runs on all rows at a level, but now only for rows with depth > 0. In most cases, we can assume that the number of children (not descendents) under a given parent remains within a safe range (or else server-side data should be used).

However, we should still work on introducing partial dictionaries where possible to improve performance for these cases.

@MBilalShafi MBilalShafi added performance scope: data grid Changes related to the data grid. type: regression A bug, but worse, it used to behave as expected. feature: Selection Related to the data grid Selection feature labels Aug 1, 2025
@mui-bot
Copy link

mui-bot commented Aug 1, 2025

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

Bundle size report

Bundle Parsed Size Gzip Size
@mui/x-data-grid 🔺+38B(+0.01%) 🔺+13B(+0.01%)
@mui/x-data-grid/DataGrid 🔺+38B(+0.01%) 🔺+9B(+0.01%)
@mui/x-data-grid-pro 🔺+38B(+0.01%) 🔺+19B(+0.01%)
@mui/x-data-grid-pro/DataGridPro 🔺+38B(+0.01%) 🔺+21B(+0.02%)
@mui/x-data-grid-premium 🔺+38B(+0.01%) 🔺+11B(+0.01%)
@mui/x-data-grid-premium/DataGridPremium 🔺+38B(+0.01%) 🔺+10B(+0.01%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 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 80a0ce5

@MBilalShafi MBilalShafi merged commit 3f9fb89 into mui:master Aug 4, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: Selection Related to the data grid Selection feature performance scope: data grid Changes related to the data grid. type: regression A bug, but worse, it used to behave as expected.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[data grid] grid freezes when isRowSelectable is used with a large number of rows
3 participants