fix(grid): focus cell before detail

This commit is contained in:
t8y2 committed 2026-05-22 19:02:08 +08:00
1 parent a26a762b8c
commit c2a13f3057
2 files changed
+20 -1

No files matched your search

@@ -1,3 +1,4 @@
import { readFileSync } from "node:fs";
import { strict as assert } from "node:assert";
import test from "node:test";
import {
@@ -76,3 +77,15 @@ test("cell detail does not follow selection while closed or editing", () => {
assert.equal(linkedCellDetailTarget({ isOpen: true, isEditing: true, selectedCell, actualColumnIndex }), null);
assert.equal(linkedCellDetailTarget({ isOpen: true, isEditing: false, selectedCell: null, actualColumnIndex }), null);
});
test("cell detail action focuses the hovered cell before opening details", () => {
const source = readFileSync("apps/desktop/src/components/grid/DataGrid.vue", "utf8");
assert.match(
source,
/function showCellDetailsForVisibleCell\(rowIndex: number, visibleColIdx: number, actualColIdx: number\)/,
);
assert.match(source, /selectSingleCell\(rowIndex, visibleColIdx\)/);
assert.match(source, /@click\.stop="showCellDetailsForVisibleCell\(index, visibleColIdx, actualColIdx\)"/);
assert.doesNotMatch(source, /@click\.stop="showCellDetails\(index, actualColIdx\)"/);
});