diff --git a/src/components/IconSet.vue b/src/components/IconSet.vue index 6531d4fe..a0b926c6 100755 --- a/src/components/IconSet.vue +++ b/src/components/IconSet.vue @@ -104,12 +104,19 @@ watch( onMounted(() => { search.value = route.query.s as string || '' - watch([search, collection], () => { + watch([search], () => { + synchronizeSearchQuery() + }) + watch([collection], () => { if (search.value) - router.replace({ query: { s: search.value } }) + synchronizeSearchQuery() }) }) +function synchronizeSearchQuery() { + router.replace({ query: { s: search.value } }) +} + function focusSearch() { searchbar.value?.input.focus() }