From 03df96136c9b6908087e7642ffb2741d44653580 Mon Sep 17 00:00:00 2001 From: Kevin Gorjan Date: Fri, 25 Feb 2022 10:31:01 +0100 Subject: [PATCH 1/3] fix(theme): refactored when clicking outside the search-results --- .../components/Header/SearchBar/SearchBar.vue | 23 +++++++++++++++---- .../click-outside/click-outside-directive.js | 19 +++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 packages/theme/utilities/directives/click-outside/click-outside-directive.js diff --git a/packages/theme/components/Header/SearchBar/SearchBar.vue b/packages/theme/components/Header/SearchBar/SearchBar.vue index fd590adc3..4c6dd1eeb 100644 --- a/packages/theme/components/Header/SearchBar/SearchBar.vue +++ b/packages/theme/components/Header/SearchBar/SearchBar.vue @@ -51,7 +51,7 @@ + + From fa0f57338f7701e6958d076a69899371b9715ef1 Mon Sep 17 00:00:00 2001 From: Kevin Gorjan Date: Fri, 25 Feb 2022 11:10:31 +0100 Subject: [PATCH 3/3] fix(theme): refactored watcher --- packages/theme/components/Header/SearchBar/SearchBar.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/theme/components/Header/SearchBar/SearchBar.vue b/packages/theme/components/Header/SearchBar/SearchBar.vue index dad69cfd7..5cc7ea915 100644 --- a/packages/theme/components/Header/SearchBar/SearchBar.vue +++ b/packages/theme/components/Header/SearchBar/SearchBar.vue @@ -160,8 +160,9 @@ export default defineComponent({ emit('SearchBar:result', result.value); }, 1000); - watch(route, (event) => { - closeSearch(event); + watch(route, () => { + hideSearch(); + term.value = ''; }); return {