Skip to content

[tree view] when child is selected and parent is collapsed, the parent node sometimes displays as unselected #19191

@jon-cullison

Description

@jon-cullison

Steps to reproduce

Steps:

  1. Open this link to live example: https://stackblitz.com/edit/wnj5a88b-evgtfe5s?file=src%2FDemo.tsx
  2. Expand Data Grid
  3. Click the checkbox of a child item
  4. Collapse Data Grid
  5. Expand another top level node.

Current behavior

The parent checkbox appears to be unchecked.

Here is a video demonstration of the current behavior:
https://github.com/user-attachments/assets/e6af68b6-e752-45b9-828c-fdae3fc307cc

Expected behavior

The parent checkbox should retain an indeterminate or checked state based on child selections.

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: treeview indeterminate state

Metadata

Metadata

Assignees

Labels

scope: tree viewChanges related to the tree view. This includes TreeView, TreeItem.type: bugIt doesn't behave as expected.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions