@mui/x-data-grid 8.28.5 → 8.28.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,37 @@
5
5
  All notable changes to this project will be documented in this file.
6
6
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
7
 
8
+ ## 8.28.6
9
+
10
+ _May 13, 2026_
11
+
12
+ We'd like to extend a big thank you to the 2 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ - 🐞 Bugfixes
15
+
16
+ The following team members contributed to this release:
17
+ @LukasTy, @MBilalShafi
18
+
19
+ ### Data Grid
20
+
21
+ #### `@mui/x-data-grid@8.28.6`
22
+
23
+ Internal changes.
24
+
25
+ #### `@mui/x-data-grid-pro@8.28.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
26
+
27
+ Same changes as in `@mui/x-data-grid@8.28.6`, plus:
28
+
29
+ - [DataGridPro] Preserve parent selection for non-selectable children (@MBilalShafi) (#22013)
30
+
31
+ #### `@mui/x-data-grid-premium@8.28.6` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
32
+
33
+ Same changes as in `@mui/x-data-grid-pro@8.28.6`.
34
+
35
+ ### Docs
36
+
37
+ - [docs] Replace broken CodeSandbox iframes in migration guides (#22380) @LukasTy
38
+
8
39
  ## 8.28.5
9
40
 
10
41
  _May 8, 2026_
@@ -324,6 +324,21 @@ export const useGridRowSelection = (apiRef, props) => {
324
324
  ids: new Set(currentSelection.ids)
325
325
  };
326
326
  const selectionManager = createRowSelectionManager(newSelectionModel);
327
+ const isOrHasSelectableDescendant = nodeId => {
328
+ const node = rowTree[nodeId];
329
+ if (!node) {
330
+ return false;
331
+ }
332
+
333
+ // Only consider nodes that are present (not filtered out) when using client-side filtering.
334
+ if (props.filterMode !== 'server' && filteredRowsLookup[nodeId] === false) {
335
+ return false;
336
+ }
337
+ if (node.type !== 'group') {
338
+ return Boolean(rowsLookup[nodeId]) && apiRef.current.isRowSelectable(nodeId);
339
+ }
340
+ return node.children.some(childId => isOrHasSelectableDescendant(childId));
341
+ };
327
342
  let hasChanged = false;
328
343
  for (const id of currentSelection.ids) {
329
344
  if (isNonExistent(id)) {
@@ -346,7 +361,8 @@ export const useGridRowSelection = (apiRef, props) => {
346
361
  continue;
347
362
  }
348
363
  // Keep previously selected tree data parents selected if all their children are filtered out
349
- if (!node.children.every(childId => filteredRowsLookup[childId] === false)) {
364
+ // or not selectable.
365
+ if (node.children.some(childId => filteredRowsLookup[childId] !== false && isOrHasSelectableDescendant(childId))) {
350
366
  selectionManager.unselect(id);
351
367
  hasChanged = true;
352
368
  }
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v8.28.5
2
+ * @mui/x-data-grid v8.28.6
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -332,6 +332,21 @@ const useGridRowSelection = (apiRef, props) => {
332
332
  ids: new Set(currentSelection.ids)
333
333
  };
334
334
  const selectionManager = (0, _gridRowSelectionManager.createRowSelectionManager)(newSelectionModel);
335
+ const isOrHasSelectableDescendant = nodeId => {
336
+ const node = rowTree[nodeId];
337
+ if (!node) {
338
+ return false;
339
+ }
340
+
341
+ // Only consider nodes that are present (not filtered out) when using client-side filtering.
342
+ if (props.filterMode !== 'server' && filteredRowsLookup[nodeId] === false) {
343
+ return false;
344
+ }
345
+ if (node.type !== 'group') {
346
+ return Boolean(rowsLookup[nodeId]) && apiRef.current.isRowSelectable(nodeId);
347
+ }
348
+ return node.children.some(childId => isOrHasSelectableDescendant(childId));
349
+ };
335
350
  let hasChanged = false;
336
351
  for (const id of currentSelection.ids) {
337
352
  if (isNonExistent(id)) {
@@ -354,7 +369,8 @@ const useGridRowSelection = (apiRef, props) => {
354
369
  continue;
355
370
  }
356
371
  // Keep previously selected tree data parents selected if all their children are filtered out
357
- if (!node.children.every(childId => filteredRowsLookup[childId] === false)) {
372
+ // or not selectable.
373
+ if (node.children.some(childId => filteredRowsLookup[childId] !== false && isOrHasSelectableDescendant(childId))) {
358
374
  selectionManager.unselect(id);
359
375
  hasChanged = true;
360
376
  }
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v8.28.5
2
+ * @mui/x-data-grid v8.28.6
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "8.28.5",
3
+ "version": "8.28.6",
4
4
  "author": "MUI Team",
5
5
  "description": "The Community plan edition of the MUI X Data Grid components.",
6
6
  "license": "MIT",