Skip to content

Commit

Permalink
fix broken selection when there are invisible columns (#4410)
Browse files Browse the repository at this point in the history
Co-authored-by: Oli Folkerd <oliver.folkerd@gmail.com>
  • Loading branch information
azmy60 and olifolkerd authored Mar 11, 2024
1 parent 4ea02dd commit f99e5fa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/js/modules/SelectRange/SelectRange.js
Original file line number Diff line number Diff line change
Expand Up @@ -845,16 +845,17 @@ export default class SelectRange extends Module {
}

resetRanges() {
var range, cell;
var range, cell, visibleCells;

this.ranges.forEach((range) => range.destroy());
this.ranges = [];

range = this.addRange();

if(this.table.rowManager.activeRows.length){
cell = this.table.rowManager.activeRows[0].cells[this.rowHeader ? 1 : 0];

visibleCells = this.table.rowManager.activeRows[0].cells.filter((cell) => cell.column.visible);
cell = visibleCells[this.rowHeader ? 1 : 0];

if(cell){
range.setBounds(cell);
this.initializeFocus(cell);
Expand Down

0 comments on commit f99e5fa

Please sign in to comment.