Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[data grid] Maximum update depth exceeded. Use controlled rowSelectionModel with disabled rowSelection #15960

Open
headironc opened this issue Dec 20, 2024 · 2 comments
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Selection Related to the data grid Selection feature support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@headironc
Copy link
Contributor

headironc commented Dec 20, 2024

Steps to reproduce

Steps:

  1. Open this link to live example: (demo)
  2. Click the checkbox not disabled
  3. Check the console, found infinite rowSelectionModel changed

Current behavior

Click the avalible checkbox, and the rowSelectionModel is always in the status of changing.

Expected behavior

It shouldn do nothing.

Context

No response

Your environment

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

  System:
    OS: macOS 15.1.1
  Binaries:
    Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node
    npm: 10.9.0 - ~/.nvm/versions/node/v22.11.0/bin/npm
    pnpm: 9.15.1 - ~/.nvm/versions/node/v22.11.0/bin/pnpm
  Browsers:
    Chrome: 131.0.6778.205
    Edge: Not Found
    Safari: 18.1.1
  npmPackages:
    @emotion/react: ^11.14.0 => 11.14.0
    @emotion/styled: ^11.14.0 => 11.14.0
    @mui/base: 5.0.0-beta.67 => 5.0.0-beta.67
    @mui/lab: 6.0.0-beta.20 => 6.0.0-beta.20
    @mui/material: ^6.2.1 => 6.2.1
    @mui/material-nextjs: ^6.2.1 => 6.2.1
    @mui/x-data-grid-pro: ^7.23.3 => 7.23.3
    @mui/x-license: 7.23.2 => 7.23.2
    @types/react: ^19.0.2 => 19.0.2
    react: ^19.0.0 => 19.0.0
    react-dom: ^19.0.0 => 19.0.0
    typescript: ^5.7.2 => 5.7.2

Search keywords: rowSelectionModel,rowSelection

Order ID: 85082

@headironc headironc added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Dec 20, 2024
@github-actions github-actions bot added component: data grid This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ labels Dec 20, 2024
@michelengelen
Copy link
Member

Hey @headironc ... this is definitely unintentional. Although I don't really understand why you would set rowSelection={false} and still try to control it with onRowSelection?

We should not fire the callback when selection changes, so it is a bug. Adding it to the board!

@michelengelen michelengelen added feature: Selection Related to the data grid Selection feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Dec 23, 2024
@github-project-automation github-project-automation bot moved this to 🆕 Needs refinement in MUI X Data Grid Dec 23, 2024
@headironc
Copy link
Contributor Author

Hey @headironc ... this is definitely unintentional. Although I don't really understand why you would set rowSelection={false} and still try to control it with onRowSelection?

We should not fire the callback when selection changes, so it is a bug. Adding it to the board!

I'm going to disable row selection during initialization, if certain conditions are met to allow partial row selection. And then i found the select all button is still avalible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Selection Related to the data grid Selection feature support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/
Projects
Status: 🆕 Needs refinement
Development

No branches or pull requests

2 participants