-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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] Make checkboxSelection
respect the disableMultipleRowSelection
prop
#11448
[DataGrid] Make checkboxSelection
respect the disableMultipleRowSelection
prop
#11448
Conversation
Deploy preview: https://deploy-preview-11448--material-ui-x.netlify.app/ Updated pages: |
if (props.signature === GridSignature.DataGrid) { | ||
// DataGrid Community has multiple row selection enabled only if checkbox selection is enabled. | ||
return props.checkboxSelection && props.disableMultipleRowSelection !== true; | ||
} | ||
return !props.disableMultipleRowSelection; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit messy, but the main change in this PR is that you can now pass the disableMultipleRowSelection
prop to MIT DataGrid
.
The default behavior hasn't changed, so this PR does not bring any breaking changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels more natural now 👍
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Does it work with Data-Grid-Pro for u guys? |
@Ciframa Sure, here's a demo: https://stackblitz.com/edit/react-bvyzcm |
Closes #5286
Preview: https://deploy-preview-11448--material-ui-x.netlify.app/x/react-data-grid/row-selection/#checkbox-selection