Skip to content

Commit 213e61a

Browse files
tritontridenttritontrident
andauthored
fix: hybrid selection model to handle case when the selectedCell is none (#1158)
Calling grid.resetActiveCell() when using the new hybrid selection model raises an error. This commit fixes it. Co-authored-by: tritontrident <[email protected]>
1 parent 1fcaf16 commit 213e61a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/plugins/slick.hybridselectionmodel.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ export class SlickHybridSelectionModel {
254254
return this._options?.rowSelectOverride(data, this, this._grid);
255255
}
256256

257+
if (!Utils.isDefined(data.cell)) { return false; }
258+
257259
if (this._options?.handleRowMoveManagerColumn) {
258260
const rowMoveManager = this.getRowMoveManagerPlugin();
259261
if (rowMoveManager?.isHandlerColumn(data.cell)) { return true; }
@@ -270,7 +272,7 @@ export class SlickHybridSelectionModel {
270272
this._activeSelectionIsRow = this.rowSelectionModelIsActive(args);
271273

272274
if (this._activeSelectionIsRow) {
273-
if (this._options?.selectActiveRow && args.row !== null) {
275+
if (this._options?.selectActiveRow && isRowDefined) {
274276
this.setSelectedRanges([new SlickRange(args.row, 0, args.row, this._grid.getColumns().length - 1)], undefined, '');
275277
}
276278
} else {

0 commit comments

Comments
 (0)