From 7151f73d27a24ea50e98990713cbcecf922024b0 Mon Sep 17 00:00:00 2001 From: Johan Bisse Mattsson Date: Tue, 12 Nov 2024 15:31:46 +0100 Subject: [PATCH] Add hidden textarea for supersearch value in lxl-web --- lxl-web/src/lib/components/Search.svelte | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lxl-web/src/lib/components/Search.svelte b/lxl-web/src/lib/components/Search.svelte index 050b78ed8..d0ae4446f 100644 --- a/lxl-web/src/lib/components/Search.svelte +++ b/lxl-web/src/lib/components/Search.svelte @@ -15,8 +15,8 @@ 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(); + ? $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 @@ -30,7 +30,7 @@ /** Update input value after navigation on /find route */ if (to?.url) { let param = showAdvanced ? '_q' : '_i'; - q = $page.params.fnurgel ? '' : new URL(to.url).searchParams.get(param)?.trim(); + q = $page.params.fnurgel ? '' : new URL(to.url).searchParams.get(param)?.trim() || ''; } }); @@ -45,7 +45,12 @@
{#if env?.PUBLIC_USE_SUPERSEARCH === 'true'} - + + {:else}