fix(query): isolate duplicated tab rename state

This commit is contained in:
GIWTO authored and GitHub committed 2026-07-29 01:05:23 +08:00
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);
}
});
}