Skip to content

[data grid] Indeterminate not updated correctly for deselecting all rows #19434

@wilhelm-mailaender-milecrew

Description

Steps to reproduce

Steps:

  1. Open this link to live example: (required)
  2. https://codesandbox.io/embed/zfh88l?module=/src/Demo.tsx&fontsize=12
  3. (It's easier to reduce the number of rows, for example to 2)
  4. Select all entries with the checkbox in the header
  5. Deselect all entries in the data-grid one by one with the checkbox in the rows

Current behavior

After deselecting all entries, the checkbox in the header still has the indeterminate state.

Image

Deselecting all entries with the checkbox in the header, then selecting all entries one by one and then deselecting again one by one does not produce the indeterminate header checkbox. Only selecting all entries with the header checkbox, then deselecting all entries one by one.

Expected behavior

After deselecting all entries, the checkbox in the header should no longer be indeterminate.

Context

No response

Your environment

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

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36

Search keywords: data-grid indeterminate

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature: SelectionRelated to the data grid Selection featurescope: data gridChanges related to the data grid.type: bugIt doesn't behave as expected.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions