From 677317244e47b2f84dd09dd6b383047e66537a24 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sun, 7 Jun 2026 12:38:33 -0400 Subject: [PATCH] fix(modal): Enter accepts the fandom instead of reopening the dropdown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Enter handler listened in the bubbling phase, so Vuetify's own input handler (which opens the menu on Enter) fired first and my accept logic saw the menu already opening and bailed — Enter popped the dropdown instead of submitting. Bind it in the capture phase so it runs first, and stop the event when a fandom is already selected so Vuetify never reopens the menu (operator-flagged 2026-06-07). Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/components/modal/FandomPicker.vue | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/modal/FandomPicker.vue b/frontend/src/components/modal/FandomPicker.vue index 8f1147e..cb84aa2 100644 --- a/frontend/src/components/modal/FandomPicker.vue +++ b/frontend/src/components/modal/FandomPicker.vue @@ -19,7 +19,7 @@ :item-title="(f) => f.name" :item-value="(f) => f.id" label="Fandom" clearable density="compact" - @keydown.enter="onSearchEnter" + @keydown.enter.capture="onSearchEnter" @keydown.tab="onSearchTab" /> @@ -92,12 +92,20 @@ function onConfirm () { if (f) emit('confirm', f) } -// Enter on the search field. When the menu is open Vuetify is picking the -// highlighted item (it sets selectedId + closes the menu) — don't also accept -// on that keystroke. With the menu closed and a value chosen, Enter accepts. -function onSearchEnter () { +// Enter on the search field — bound in the CAPTURE phase so this runs BEFORE +// Vuetify's own input keydown handler (which opens the menu on Enter). When the +// menu is open, let Vuetify pick the highlighted item (it sets selectedId + +// closes the menu). When it's closed and a fandom is already chosen, accept it +// and stop the event so Vuetify never (re)opens the menu — that re-open was the +// bug: Enter popped the dropdown instead of submitting (operator-flagged +// 2026-06-07). +function onSearchEnter (e) { if (menuOpen.value) return - if (selectedId.value != null) onConfirm() + if (selectedId.value != null) { + e.preventDefault() + e.stopPropagation() + onConfirm() + } } // Tab from the search field goes to the "new fandom" text field (operator-