fix(grid): sync cell details on mouse selection

This commit is contained in:
zipg authored and GitHub committed 2026-08-12 00:12:02 +08:00
1 parent b8f4386a6b
commit 971871132b
2 files changed
+12 -1

No files matched your search

@@ -6190,7 +6190,7 @@ function onTransposeCellContext(rowIndex: number, actualColIdx: number, event: M
contextCell.value = item ? { rowId: item.id, rowIndex, col: actualColIdx } : null;
}
watch([selectedRange, showCellDetail, isEditingDetail], () => {
watch([selectedRange, showCellDetail, isEditingDetail, isSelectingCells], () => {
if (isSelectingCells.value) return;
const selectedCell = currentSelectedCellPosition();
const target = linkedCellDetailTarget({
@@ -0,0 +1,11 @@
import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
const dataGridSource = readFileSync(new URL("../DataGrid.vue", import.meta.url), "utf8");
describe("DataGrid cell detail selection", () => {
it("resynchronizes the open detail after a mouse selection gesture finishes", () => {
expect(dataGridSource).toContain("watch([selectedRange, showCellDetail, isEditingDetail, isSelectingCells]");
expect(dataGridSource).toContain("if (isSelectingCells.value) return;");
});
});