Always focus the search field after results have been fetched

Close #948

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-11-26 09:23:41 +01:00
parent 22550a60e9
commit 566d84b957
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -18,6 +18,7 @@
icon="magnify" icon="magnify"
type="search" type="search"
id="search" id="search"
ref="autocompleteSearchInput"
:value="search" :value="search"
@input="debouncedUpdateSearchQuery" @input="debouncedUpdateSearchQuery"
dir="auto" dir="auto"
@ -276,6 +277,9 @@ const GEOHASH_DEPTH = 9; // put enough accuracy, radius will be used anyway
update(data) { update(data) {
this.searchEvents = data.searchEvents; this.searchEvents = data.searchEvents;
this.searchGroups = data.searchGroups; this.searchGroups = data.searchGroups;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
this.$refs.autocompleteSearchInput?.focus();
}, },
}, },
currentUser: CURRENT_USER_CLIENT, currentUser: CURRENT_USER_CLIENT,
@ -362,6 +366,7 @@ export default class Search extends Vue {
$refs!: { $refs!: {
aac: FullAddressAutoComplete; aac: FullAddressAutoComplete;
autocompleteSearchInput: any;
}; };
data(): Record<string, unknown> { data(): Record<string, unknown> {