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

[DataGrid] Fix deselection not working with isRowSelectable #15692

Merged
merged 9 commits into from
Dec 3, 2024

Conversation

MBilalShafi
Copy link
Member

@MBilalShafi MBilalShafi commented Dec 1, 2024

Fixes #15676

This fix comes with a behavioral change.

Previous Behavior: When some rows were marked as "not selectable" using isRowSelectable, the "select all" checkbox could never be checked, it's always in "indeterminate" mode even if all the "selectable" rows are checked.

Updated Behavior: "Select all" checkbox status is based on the selectable rows only. When all the selectable rows are checked, "select all" checkbox will be checked even if there are a few unselectable rows not checked.

Found similar behavior with some other libraries, examples:

  • AgGrid
  • Sync Fusion Data Grid

ToDos:

  • Add test coverage
  • Add BC to migration guide

Changelog

Breaking changes

  • The "Select all" checkbox would now be checked when all the selectable rows are selected, ignoring rows that are not selectable because of the isRowSelectable prop.

@MBilalShafi MBilalShafi added 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 labels Dec 1, 2024
@mui-bot
Copy link

mui-bot commented Dec 1, 2024

@MBilalShafi MBilalShafi marked this pull request as ready for review December 3, 2024 09:40
@MBilalShafi MBilalShafi requested a review from a team December 3, 2024 09:41
Co-authored-by: Armin Mehinovic <4390250+arminmeh@users.noreply.github.com>
Co-authored-by: Kenan Yusuf <kenan.m.yusuf@gmail.com>
Signed-off-by: Bilal Shafi <bilalshafidev@gmail.com>
@MBilalShafi MBilalShafi enabled auto-merge (squash) December 3, 2024 11:13
@MBilalShafi MBilalShafi merged commit d1f324f into mui:master Dec 3, 2024
16 checks passed
@MBilalShafi MBilalShafi deleted the bugfix/15676 branch December 3, 2024 11:53
LukasTy pushed a commit to LukasTy/mui-x that referenced this pull request Dec 19, 2024
)

Co-authored-by: Armin Mehinovic <4390250+arminmeh@users.noreply.github.com>
Co-authored-by: Kenan Yusuf <kenan.m.yusuf@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change 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 v8.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DataGrid] Cannot deselect all rows when isRowSelectable is used
5 participants