fix(query): isolate duplicated tab rename state
This commit is contained in:
1 parent
234f26ada8
commit
b7e3b2ee57
3 files changed
+28
-3
No files matched your search
@@ -129,8 +129,12 @@ function startRenameTab(tab: QueryTab) {
|
||||
editingTitle.value = tab.title;
|
||||
nextTick(() => {
|
||||
const input = document.querySelector<HTMLInputElement>(`[data-tab-title-input="${tab.id}"]`);
|
||||
input?.focus();
|
||||
input?.select();
|
||||
if (input) {
|
||||
input.focus();
|
||||
const dotIndex = input.value.lastIndexOf(".");
|
||||
const selectEnd = dotIndex > 0 ? dotIndex : input.value.length;
|
||||
input.setSelectionRange(0, selectEnd);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1933,7 +1933,9 @@ export const useQueryStore = defineStore("query", () => {
|
||||
database: original.database,
|
||||
schema: original.schema,
|
||||
sql: original.sql,
|
||||
savedSqlId: original.savedSqlId,
|
||||
originalSql: "",
|
||||
savedSqlId: undefined,
|
||||
externalSqlPath: undefined,
|
||||
lastExecutedSql: undefined,
|
||||
resultBaseSql: original.resultBaseSql,
|
||||
resultSortedSql: undefined,
|
||||
|
||||
Reference in new issue
Block a user