From c9bf3912f8922d4cbc1fad73b88b68c6df5df447 Mon Sep 17 00:00:00 2001 From: 409 <409dev@protonmail.com> Date: Wed, 16 Jul 2025 08:31:45 +0200 Subject: [PATCH] enter in create / rename dialog to submit --- frontend/components/actions/CreateDirectoryDialog.vue | 11 +++++++++++ frontend/components/actions/RenameEntryDialog.vue | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/frontend/components/actions/CreateDirectoryDialog.vue b/frontend/components/actions/CreateDirectoryDialog.vue index abce476..156da96 100644 --- a/frontend/components/actions/CreateDirectoryDialog.vue +++ b/frontend/components/actions/CreateDirectoryDialog.vue @@ -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(); + } +}