From ac0dc4ee7627ba907c401c0c3d78746546b269b2 Mon Sep 17 00:00:00 2001 From: Alan Ren Date: Fri, 3 Feb 2023 20:40:22 -0800 Subject: [PATCH] only toggle when enabled (#21844) --- .../table/plugins/checkboxSelectColumn.plugin.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/sql/base/browser/ui/table/plugins/checkboxSelectColumn.plugin.ts b/src/sql/base/browser/ui/table/plugins/checkboxSelectColumn.plugin.ts index b97ac4539d..de00cfe36c 100644 --- a/src/sql/base/browser/ui/table/plugins/checkboxSelectColumn.plugin.ts +++ b/src/sql/base/browser/ui/table/plugins/checkboxSelectColumn.plugin.ts @@ -132,12 +132,14 @@ export class CheckboxSelectColumn implements Slick.Pl private toggleCellCheckbox(row: number): void { const currentValue = this.getCheckboxPropertyValue(row); - this.setCheckboxPropertyValue(row, !currentValue.checked); - this._grid.invalidateRow(row); - this._grid.render(); - this._grid.setActiveCell(row, this.index); - this.updateSelectAllCheckboxState(); - this._onChange.fire({ checked: !currentValue.checked, row: row, column: this.index }); + if (currentValue.enabled) { + this.setCheckboxPropertyValue(row, !currentValue.checked); + this._grid.invalidateRow(row); + this._grid.render(); + this._grid.setActiveCell(row, this.index); + this.updateSelectAllCheckboxState(); + this._onChange.fire({ checked: !currentValue.checked, row: row, column: this.index }); + } } private handleHeaderClick(e: Event, args?: Slick.OnHeaderClickEventArgs): void {