fix(grid): reset filter/sort when reusing data tab

This commit is contained in:
t8y2 2026-06-24 12:51:46 +08:00
parent 39796f2b38
commit c411cc6707
1 changed files with 9 additions and 0 deletions

View File

@ -888,6 +888,15 @@ async function openData() {
if (existing) {
existing.title = node.label;
existing.schema = tableSchema;
// Reset per-table filter/sort state so the reused tab doesn't keep
// the previous table's WHERE/ORDER BY. DataGrid remounts (result is
// cleared below) and reinitializes its inputs from these props.
existing.whereInput = undefined;
existing.orderByInput = undefined;
existing.resultSortColumn = undefined;
existing.resultSortColumnIndex = undefined;
existing.resultSortDirection = undefined;
existing.resultSortedSql = undefined;
queryStore.activeTabId = existing.id;
return existing.id;
}