Shift+click on column/row headers extends the selection

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
wkh
2026-09-28 19:10:46 +02:00
co-authored by Claude Opus 5.5
parent 83f365ce3f
commit 8e974cc870
+6 -2
View File
@@ -720,7 +720,9 @@ function selectColumn(c: number, e?: MouseEvent) {
const t = table.value; const t = table.value;
if (!t) return; if (!t) return;
clearFlow(); 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 }; const f = { col: c, row: t.rows - 1 };
if (e && (e.metaKey || e.ctrlKey)) store.addRangeToSelection(props.tableId, a, f); if (e && (e.metaKey || e.ctrlKey)) store.addRangeToSelection(props.tableId, a, f);
else store.setSelection({ tableId: props.tableId, anchor: a, focus: 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; const t = table.value;
if (!t) return; if (!t) return;
clearFlow(); 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 }; const f = { col: t.cols - 1, row: r };
if (e && (e.metaKey || e.ctrlKey)) store.addRangeToSelection(props.tableId, a, f); if (e && (e.metaKey || e.ctrlKey)) store.addRangeToSelection(props.tableId, a, f);
else store.setSelection({ tableId: props.tableId, anchor: a, focus: f }); else store.setSelection({ tableId: props.tableId, anchor: a, focus: f });