automatically focus after opening the dialog and support confirming with the enter key

This commit is contained in:
MaysWind
2026-01-11 13:24:26 +08:00
parent ee9b281919
commit ca959fb9ce
7 changed files with 66 additions and 22 deletions
@@ -9,7 +9,8 @@
:autofocus="true"
:label="tt('Explorer Name')"
:placeholder="tt('Explorer Name')"
v-model="newExplorerName"/>
v-model="newExplorerName"
@keyup.enter="save" />
</v-card-text>
<v-card-text>
<div class="w-100 d-flex justify-center flex-wrap mt-sm-1 mt-md-2 gap-4">
@@ -53,6 +54,10 @@ function open(currentExplorerName: string, title?: string): Promise<string> {
}
function save(): void {
if (!newExplorerName.value || oldExplorerName.value === newExplorerName.value) {
return;
}
resolveFunc?.(newExplorerName.value);
showState.value = false;
}