Skip to content

Commit

Permalink
fix: never activate more than 1 cell, clear any previous active CSS c…
Browse files Browse the repository at this point in the history
…lass (#1100)
  • Loading branch information
ghiscoding authored Jan 16, 2025
1 parent ed27077 commit 7ff7170
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/slick.grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5952,6 +5952,8 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e
}

if (this._options.showCellSelection) {
// make sure to never activate more than 1 cell at a time
document.querySelectorAll('.slick-cell.active').forEach((node) => node.classList.remove('active'));
this.activeCellNode.classList.add('active');
this.rowsCache[this.activeRow]?.rowNode?.forEach((node) => node.classList.add('active'));
}
Expand Down Expand Up @@ -7043,4 +7045,4 @@ if (IIFE_ONLY && window.Slick) {
Utils.extend(Slick, {
Grid: SlickGrid,
});
}
}

0 comments on commit 7ff7170

Please sign in to comment.