fix(grid): restore column jump in transposed table view

This commit is contained in:
zipg authored and GitHub committed 2026-09-15 17:52:53 +08:00
1 parent 5a0e74eec6
commit b06e952ba0
2 files changed
+32 -17

No files matched your search

+12
View File
@@ -164,3 +164,15 @@ test("error result recovery participates in canvas observer remounts", () => {
const source = readFileSync("apps/desktop/src/components/grid/DataGrid.vue", "utf8");
assert.match(source, /watch\(\s*\[useCanvasGridRows, hasVisibleRows, isErrorResult\]/);
});
test("column navigation scrolls visible transpose fields before looking for the normal grid", () => {
const source = readFileSync("apps/desktop/src/components/grid/DataGrid.vue", "utf8");
const navigation = source.slice(source.indexOf("function scrollToColumnIndex("), source.indexOf("// --- Column resize composable ---"));
assert.match(navigation, /showColumn\(columnIndex\)/);
assert.match(navigation, /visibleColumnIndexes\.value\.indexOf\(columnIndex\)/);
assert.match(navigation, /if \(isTransposeMode\.value\) \{\s*scrollTransposeFieldIntoView\(visibleColIdx\);\s*return;/);
assert.ok(navigation.indexOf("scrollTransposeFieldIntoView") < navigation.indexOf('".data-grid-scroller"'));
assert.match(source, /scrollToItem\?\.\(visibleFieldIndex\)/);
assert.match(source, /scroller\.scrollTop = visibleFieldIndex \* transposeRowHeight\.value/);
assert.match(source, /'ring-2 ring-inset ring-primary': highlightedColumnIndex === visibleColumnIndexes\[index\]/);
});