From ee78c63afa68c0c70c3c9206e22820200eac4d8f Mon Sep 17 00:00:00 2001 From: mirkobrombin Date: Fri, 19 Jul 2024 22:50:03 +0200 Subject: [PATCH] fix: clicking on a search result closes the search without forwarding --- src/App.vue | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/App.vue b/src/App.vue index bf59271..1ab2b77 100644 --- a/src/App.vue +++ b/src/App.vue @@ -12,7 +12,8 @@
+ type="text" placeholder="Search for articles.." v-model="search" @input="searchArticles" + @blur="emptySearch()"> search
@@ -37,7 +38,7 @@
+ v-for="(result, index) in searchResponse" :key="index" @mousedown.prevent="goToArticle(result.Slug)">
book
@@ -145,9 +146,9 @@ export default defineComponent({ // @ts-ignore const response = await this.$chronosAPI.searchArticles(this.chronosStore.prefLang, this.search, this.collectionShortName); if (response != null) { - this.searchResponse = response; + this.searchResponse = response; } else { - this.searchResponse = []; + this.searchResponse = []; } } catch (error) { console.error("Error searching articles:", error); @@ -181,8 +182,8 @@ export default defineComponent({ this.isDarkMode = isDarkMode; }, emptySearch() { - this.searchResponse = []; - console.log("Focus lost") + this.searchResponse = []; + console.log("Focus lost") }, }, });