diff --git a/app/components/Header/SearchBox.vue b/app/components/Header/SearchBox.vue index 6796554f4..e10bb1392 100644 --- a/app/components/Header/SearchBox.vue +++ b/app/components/Header/SearchBox.vue @@ -17,11 +17,17 @@ const showSearchBar = computed(() => { }) const { model: searchQuery, startSearch } = useGlobalSearch('header') +const hasSearchQuery = computed(() => searchQuery.value.trim().length > 0) function handleSubmit() { startSearch() } +function clearSearch() { + searchQuery.value = '' + inputRef.value?.focus() +} + // Expose focus method for parent components const inputRef = useTemplateRef('inputRef') function focus() { @@ -52,11 +58,20 @@ defineExpose({ focus }) name="q" :placeholder="$t('search.placeholder')" no-correct - class="w-full min-w-25 ps-7" + class="w-full min-w-25 ps-7 pe-8" @focus="isSearchFocused = true" @blur="isSearchFocused = false" size="small" /> +