From 8e974cc870d47bed616ff49ee458e362e385ee24 Mon Sep 17 00:00:00 2001 From: Wild Karl-Heinz Date: Mon, 28 Sep 2026 19:10:46 +0200 Subject: [PATCH] Shift+click on column/row headers extends the selection Co-Authored-By: Claude Opus 5.5 --- src/components/TableGrid.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/TableGrid.vue b/src/components/TableGrid.vue index 2d4ba94..c03b1d3 100644 --- a/src/components/TableGrid.vue +++ b/src/components/TableGrid.vue @@ -720,7 +720,9 @@ function selectColumn(c: number, e?: MouseEvent) { const t = table.value; if (!t) return; clearFlow(); - const a = { col: c, row: 0 }; + // Shift extends from the current anchor's column to the clicked one + const from = e?.shiftKey && mine.value ? mine.value.anchor.col : c; + const a = { col: from, row: 0 }; const f = { col: c, row: t.rows - 1 }; if (e && (e.metaKey || e.ctrlKey)) store.addRangeToSelection(props.tableId, a, f); else store.setSelection({ tableId: props.tableId, anchor: a, focus: f }); @@ -730,7 +732,9 @@ function selectRow(r: number, e?: MouseEvent) { const t = table.value; if (!t) return; clearFlow(); - const a = { col: 0, row: r }; + // Shift extends from the current anchor's row to the clicked one + const from = e?.shiftKey && mine.value ? mine.value.anchor.row : r; + const a = { col: 0, row: from }; const f = { col: t.cols - 1, row: r }; if (e && (e.metaKey || e.ctrlKey)) store.addRangeToSelection(props.tableId, a, f); else store.setSelection({ tableId: props.tableId, anchor: a, focus: f });