-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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] Update selected rows when turning off checkboxSelection
#3684
Conversation
These are the results for the performance tests:
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
392b339
to
28e4d1b
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
28e4d1b
to
151a6e6
Compare
151a6e6
to
365113a
Compare
365113a
to
84f9544
Compare
packages/grid/_modules_/grid/hooks/features/selection/useGridSelection.ts
Outdated
Show resolved
Hide resolved
|
||
const firstSelectableRow = currentSelection.find((id) => { | ||
let isSelectable = true; | ||
if (typeof isRowSelectable === 'function') { |
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.
if (typeof isRowSelectable === 'function') { | |
if (isRowSelectable) { |
Like in line 479. I was looking for what are the other types of isRowSelectable
Steps to reproduce
checkboxSelection
Proposed solution
If
checkboxSelection
is turned off, then we cleanselectionModel
to keep only one row selected.CodeSandbox with the fix: https://codesandbox.io/s/datagriddemo-material-demo-forked-jjoyn?file=/demo.tsx