From a6abb22cfcceafe9a41639e940ac0c26c6cb7830 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 26 Nov 2021 09:23:41 +0100 Subject: [PATCH] Always focus the search field after results have been fetched Close #948 Signed-off-by: Thomas Citharel --- js/src/views/Search.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/src/views/Search.vue b/js/src/views/Search.vue index f2d213394..bbfcca6d7 100644 --- a/js/src/views/Search.vue +++ b/js/src/views/Search.vue @@ -18,6 +18,7 @@ icon="magnify" type="search" id="search" + ref="autocompleteSearchInput" :value="search" @input="debouncedUpdateSearchQuery" dir="auto" @@ -276,6 +277,9 @@ const GEOHASH_DEPTH = 9; // put enough accuracy, radius will be used anyway update(data) { this.searchEvents = data.searchEvents; this.searchGroups = data.searchGroups; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + this.$refs.autocompleteSearchInput?.focus(); }, }, currentUser: CURRENT_USER_CLIENT, @@ -362,6 +366,7 @@ export default class Search extends Vue { $refs!: { aac: FullAddressAutoComplete; + autocompleteSearchInput: any; }; data(): Record {