From 1d3d682b603eec297b26a337192c5340e7ffc916 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Mon, 25 May 2026 13:20:38 +0000 Subject: [PATCH] fix: don't steal focus from search input during focus restoration When typing in the search bar on a detail page, navigating to search results would trigger restoreFocusForPage(), which focused the 'last viewed' card and interrupted typing. Skip focus restoration whenever the search input is currently the active element. --- frontend/src/App.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index ab7b1a8..7cdea10 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -412,6 +412,10 @@ function saveFocusForPage(page: string) { // Restore focus state for a page, or find the last viewed item function restoreFocusForPage(page: string) { + // Don't steal focus from the search input while the user is typing + const active = document.activeElement + if (active?.closest(".header-search")) return + // First try to find the last viewed item and focus it if (lastViewedItemId.value) { // Use nextTick + timeout to ensure DOM is updated after navigation