diff --git a/webclient/components/AppSearchBar.vue b/webclient/components/AppSearchBar.vue index 780b7b191..db4b1b918 100644 --- a/webclient/components/AppSearchBar.vue +++ b/webclient/components/AppSearchBar.vue @@ -105,9 +105,15 @@ function onKeyDown(e: KeyboardEvent): void { } const runtimeConfig = useRuntimeConfig(); -const url = computed( - () => `${runtimeConfig.public.apiURL}/api/search?q=${encodeURIComponent(query.value)}&lang=${locale.value}`, -); +const url = computed(() => { + const params = new URLSearchParams(); + params.append("q", query.value); + params.append("lang", locale.value); + params.append("pre_highlight", ""); + params.append("post_highlight", ""); + + return `${runtimeConfig.public.apiURL}/api/search?${params.toString()}`; +}); const { data, error, refresh } = await useFetch(url, {}); // a bit crude way of doing retries, but likely fine watchEffect(() => { @@ -172,7 +178,7 @@ watchEffect(() => { v-if="i < s.n_visible" :highlighted="e.id === highlighted" :item="e" - @click="searchGoTo(e.id, false)" + @click="searchBarFocused = false" @mousedown="keep_focus = true" @mouseover="highlighted = null" > diff --git a/webclient/components/SearchResultItem.vue b/webclient/components/SearchResultItem.vue index a2e7bb7cc..ca4beaf53 100644 --- a/webclient/components/SearchResultItem.vue +++ b/webclient/components/SearchResultItem.vue @@ -20,12 +20,10 @@ type RoomEntry = components["schemas"]["RoomEntry"];