diff --git a/web/src/lib/components/shared-components/search-bar/search-bar.svelte b/web/src/lib/components/shared-components/search-bar/search-bar.svelte index d0e84fd072..8c1d2c5d08 100644 --- a/web/src/lib/components/shared-components/search-bar/search-bar.svelte +++ b/web/src/lib/components/shared-components/search-bar/search-bar.svelte @@ -30,10 +30,10 @@ let showSuggestions = $state(false); let isSearchSuggestions = $state(false); let selectedId: string | undefined = $state(); - let isFocus = $state(false); let close: (() => Promise) | undefined; const listboxId = generateId(); + const searchTypeId = generateId(); onDestroy(() => { searchStore.isSearchEnabled = false; @@ -161,12 +161,10 @@ const openDropdown = () => { showSuggestions = true; - isFocus = true; }; const closeDropdown = () => { showSuggestions = false; - isFocus = false; searchHistoryBox?.clearSelection(); }; @@ -251,6 +249,7 @@ aria-activedescendant={selectedId ?? ''} aria-expanded={showSuggestions && isSearchSuggestions} aria-autocomplete="list" + aria-describedby={searchTypeId} use:shortcuts={[ { shortcut: { key: 'Escape' }, onShortcut: onEscape }, { shortcut: { ctrl: true, shift: true, key: 'k' }, onShortcut: onFilterClick }, @@ -287,12 +286,12 @@ /> - {#if isFocus} + {#if searchStore.isSearchEnabled}
0} + class:end-28={value.length > 0} >