Shift+click on column/row headers extends the selection
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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 });
|
||||||
|
|||||||
Reference in New Issue
Block a user