diff --git a/lxl-web/src/lib/components/Search.svelte b/lxl-web/src/lib/components/Search.svelte index 94cc240c6..2f4951238 100644 --- a/lxl-web/src/lib/components/Search.svelte +++ b/lxl-web/src/lib/components/Search.svelte @@ -9,9 +9,11 @@ export let autofocus: boolean = false; $: showAdvanced = $page.url.searchParams.get('_x') === 'advanced'; - let q = showAdvanced - ? $page.url.searchParams.get('_q')?.trim() - : $page.url.searchParams.get('_i')?.trim(); + let q = $page.params.fnurgel + ? '' //don't reflect related search on resource pages + : showAdvanced + ? $page.url.searchParams.get('_q')?.trim() + : $page.url.searchParams.get('_i')?.trim(); let params = getSortedSearchParams(addDefaultSearchParams($page.url.searchParams)); // Always reset these params on new search @@ -22,10 +24,10 @@ const searchParams = Array.from(params); afterNavigate(({ to }) => { - /** Update input value after navigation */ + /** Update input value after navigation on /find route */ if (to?.url) { let param = showAdvanced ? '_q' : '_i'; - q = new URL(to.url).searchParams.get(param)?.trim(); + q = $page.params.fnurgel ? '' : new URL(to.url).searchParams.get(param)?.trim(); } }); @@ -48,7 +50,7 @@ type="search" name="_q" {placeholder} - aria-label="Sök" + aria-label={$page.data.t('search.search')} spellcheck="false" bind:value={q} {autofocus} diff --git a/lxl-web/src/lib/components/find/FacetRange.svelte b/lxl-web/src/lib/components/find/FacetRange.svelte index 69c1a1193..f2987adaa 100644 --- a/lxl-web/src/lib/components/find/FacetRange.svelte +++ b/lxl-web/src/lib/components/find/FacetRange.svelte @@ -53,7 +53,6 @@ bind:value={rangeTo} /> - diff --git a/lxl-web/src/lib/components/find/SearchRelated.svelte b/lxl-web/src/lib/components/find/SearchRelated.svelte new file mode 100644 index 000000000..2774f87bc --- /dev/null +++ b/lxl-web/src/lib/components/find/SearchRelated.svelte @@ -0,0 +1,42 @@ + + +
diff --git a/lxl-web/src/lib/components/find/SearchResult.svelte b/lxl-web/src/lib/components/find/SearchResult.svelte index d58c45efb..d419e83f2 100644 --- a/lxl-web/src/lib/components/find/SearchResult.svelte +++ b/lxl-web/src/lib/components/find/SearchResult.svelte @@ -10,6 +10,7 @@ import BiChevronDown from '~icons/bi/chevron-down'; import type { SearchResult, DisplayMapping } from '$lib/types/search'; import { shouldShowMapping } from '$lib/utils/search'; + import SearchRelated from './SearchRelated.svelte'; let showFiltersModal = false; export let searchResult: SearchResult; @@ -108,6 +109,7 @@