diff --git a/frontend/src/components/VHeader/VHeaderMobile/VHeaderMobile.vue b/frontend/src/components/VHeader/VHeaderMobile/VHeaderMobile.vue index 69414ab266e..a6d9bedb62d 100644 --- a/frontend/src/components/VHeader/VHeaderMobile/VHeaderMobile.vue +++ b/frontend/src/components/VHeader/VHeaderMobile/VHeaderMobile.vue @@ -10,7 +10,7 @@ aria-label="inputmodal" @close="deactivate" > -
+
@@ -278,6 +279,13 @@ export default defineComponent({ ensureFocus(searchInputRef.value) } } + /* Clear a specific recent search from the store. */ + const handleClearSingle = (idx: number) => { + searchStore.clearRecentSearch(idx) + if (searchInputRef.value) { + ensureFocus(searchInputRef.value) + } + } const showRecentSearches = computed( () => isRecentSearchesModalOpen.value && entries.value.length > 0 @@ -330,6 +338,7 @@ export default defineComponent({ handleKeydown, handleSelect, handleClear, + handleClearSingle, } }, }) diff --git a/frontend/src/components/VHeader/VSearchBar/VSearchBar.vue b/frontend/src/components/VHeader/VSearchBar/VSearchBar.vue index 54fcba7dc9a..250050b20cc 100644 --- a/frontend/src/components/VHeader/VSearchBar/VSearchBar.vue +++ b/frontend/src/components/VHeader/VSearchBar/VSearchBar.vue @@ -50,6 +50,7 @@ :class="recentClasses" @select="handleSelect" @clear="handleClear" + @clear-single="handleClearSingle" @keydown.tab.native="hideRecentSearches" /> @@ -227,6 +228,11 @@ export default defineComponent({ inputFieldRef.value?.focusInput() searchStore.clearRecentSearches() } + /* Clear a specific recent search from the store. */ + const handleClearSingle = (idx: number) => { + inputFieldRef.value?.focusInput() + searchStore.clearRecentSearch(idx) + } return { searchBarEl, @@ -247,6 +253,7 @@ export default defineComponent({ handleKeydown, handleSelect, handleClear, + handleClearSingle, } }, }) diff --git a/frontend/src/components/VModal/VInputModal.vue b/frontend/src/components/VModal/VInputModal.vue index 3f64834c725..5896dc805f8 100644 --- a/frontend/src/components/VModal/VInputModal.vue +++ b/frontend/src/components/VModal/VInputModal.vue @@ -10,7 +10,7 @@