fix(grid): remove auto-transpose for single-row results

Co-authored-by: cherlin <544026227@qq.com>
This commit is contained in:
cherlinbest-pixel 2026-06-20 21:48:40 +08:00 committed by GitHub
parent f71406c1c2
commit 72f90a064f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 0 additions and 13 deletions

View File

@ -229,7 +229,6 @@ const transposeRowIndex = ref<number | null>(null);
const showTranspose = ref(false);
const multiRowTranspose = ref(false);
const preserveTransposeOnNextResult = ref(false);
const autoTransposedForResult = ref(false);
watch(
() => props.result,
@ -244,16 +243,6 @@ watch(
loading: props.loading,
elapsedSinceSetup: dataGridElapsed(),
});
// Auto-transpose when a new result has exactly 1 row with multiple columns.
if (result.rows.length === 1 && result.columns.length > 1 && !preserveTransposeOnNextResult.value) {
autoTransposedForResult.value = true;
nextTick(() => {
showTranspose.value = true;
transposeRowIndex.value = 0;
});
} else {
autoTransposedForResult.value = false;
}
nextTick(() => {
console.info("[DBX][DataGrid:result:nextTick]", {
@ -5353,7 +5342,6 @@ function currentTransposeViewportRowIndex(): number {
}
function closeTranspose(scrollToCurrentRecord = true) {
autoTransposedForResult.value = false;
const rowIndex = currentTransposeViewportRowIndex();
showTranspose.value = false;
transposeRowIndex.value = null;
@ -5384,7 +5372,6 @@ function openContextTranspose() {
}
function toggleTranspose(rowIndex: number) {
autoTransposedForResult.value = false;
const next = nextTransposeState(showTranspose.value, transposeRowIndex.value, rowIndex);
transposeRowIndex.value = next.transposeRowIndex;
showTranspose.value = next.showTranspose;