Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix disableVisualSelection problem after call updateData
  • Loading branch information
adrianspdev committed Mar 31, 2025
commit cb46e9523a24b66a4d3697e15c90053bf6acb9e6
Original file line number Diff line number Diff line change
Expand Up @@ -506,5 +506,30 @@ describe('Selection', () => {
| ║ : 0 : : : |
`).toBeMatchToSelectionPattern();
});

it('should disable the selection highlight after call updateData()', () => {
const hot = handsontable({
data: createSpreadsheetData(5, 5),
rowHeaders: true,
colHeaders: true,
startRows: 5,
startCols: 5,
navigableHeaders: true,
disableVisualSelection: true,
});

selectCell(1, 1);
hot.updateData(createSpreadsheetData(5, 5), 'updateSettings');
Comment thread
adrianspdev marked this conversation as resolved.
Outdated

expect(`
| ║ : : : : |
|===:===:===:===:===:===|
| ║ : : : : |
| ║ : : : : |
| ║ : : : : |
| ║ : : : : |
| ║ : : : : |
`).toBeMatchToSelectionPattern();
});
});
});
13 changes: 8 additions & 5 deletions handsontable/src/selection/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -1281,11 +1281,14 @@ class Selection {
});

this.selectedRange.ranges.push(range);
this.highlight
.getFocus()
.add(highlight)
.commit()
.syncWith(range);

if (this.highlight.isEnabledFor(FOCUS_TYPE, this.selectedRange.current().highlight)) {
this.highlight
.getFocus()
.add(highlight)
.commit()
.syncWith(range);
}

this.applyAndCommit(range);
}
Expand Down
Loading