From 8be88cb2737cd7e473b1ace4b42189c707f84614 Mon Sep 17 00:00:00 2001 From: myml Date: Sun, 15 May 2022 09:21:23 +0800 Subject: [PATCH] fix(search): search result display as empty after clearing field (#5283) --- client/components/common/search-results.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/client/components/common/search-results.vue b/client/components/common/search-results.vue index a71fd133..64c57f41 100644 --- a/client/components/common/search-results.vue +++ b/client/components/common/search-results.vue @@ -14,7 +14,7 @@ .search-results-none(v-else-if='!searchIsLoading && (!results || results.length < 1)') img(src='/_assets/svg/icon-no-results.svg', alt='No Results') .subheading {{$t('common:header.searchNoResult')}} - template(v-if='results && results.length > 0') + template(v-if='search && search.length >= 2 && results && results.length > 0') v-subheader.white--text {{$t('common:header.searchResultsCount', { total: response.totalHits })}} v-list.search-results-items.radius-7.py-0(two-line, dense) template(v-for='(item, idx) of results') @@ -101,8 +101,6 @@ export default { search(newValue, oldValue) { this.cursor = 0 if (!newValue || (newValue && newValue.length < 2)) { - this.response.results = [] - this.response.suggestions = [] this.searchIsLoading = false } else { this.searchIsLoading = true