Skip to content

Commit

Permalink
fix: clearSelectedRows should respect enableSelection
Browse files Browse the repository at this point in the history
The issue we had was that we have rows that are selected, but also have enableSelection: false. We expected select
all to behave similarly when selecting and unselecting all rows in that select all does not touch disabled rows. But
unselect all does touch disabled rows.

This fixes the above issue by using the same check that is used during select all behavior in clearSelectedRows.
  • Loading branch information
blackwolf12333 authored and mportuga committed Apr 8, 2021
1 parent 715e59b commit fcad35c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/selection/src/js/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@
clearSelectedRows: function (grid, evt) {
var changedRows = [];
service.getSelectedRows(grid).forEach(function (row) {
if (row.isSelected) {
if (row.isSelected && row.enableSelection !== false && grid.options.isRowSelectable(row) !== false) {
row.setSelected(false);
service.decideRaiseSelectionEvent(grid, row, changedRows, evt);
}
Expand Down

0 comments on commit fcad35c

Please sign in to comment.