enter in create / rename dialog to submit

This commit is contained in:
2025-07-16 08:31:45 +02:00
parent ae290b46d3
commit c9bf3912f8
2 changed files with 19 additions and 1 deletions

View File

@@ -17,6 +17,10 @@ const creating = ref(false);
const directoryNameValid = computed(() => dialog.value.trim().length > 0);
async function submit() {
if (!directoryNameValid.value || creating.value) {
return;
}
creating.value = true;
const { success } = await createDirectory(warrenRoute.value, dialog.value);
@@ -27,6 +31,12 @@ async function submit() {
dialog.reset();
}
}
function onKeyDown(e: KeyboardEvent) {
if (e.key === 'Enter') {
submit();
}
}
</script>
<template>
@@ -50,6 +60,7 @@ async function submit() {
aria-required="true"
autocomplete="off"
required
@keydown="onKeyDown"
/>
<DialogFooter>