drop in onStartTyping to focus on search bar automatically

This commit is contained in:
geoffrey45
2022-06-16 09:50:07 +03:00
parent 79a7161827
commit 600b267ce4
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -36,6 +36,7 @@ import useQStore from "@/stores/queue";
import useShortcuts from "@/composables/useKeyboard";
import Logo from "@/components/Logo.vue";
import { useRouter } from "vue-router";
import { onStartTyping } from "@vueuse/core";
const context_store = useContextStore();
const queue = useQStore();
@@ -53,6 +54,10 @@ app_dom.addEventListener("click", (e) => {
useRouter().afterEach(() => {
document.getElementById("acontent")?.scrollTo(0, 0);
});
onStartTyping(() => {
document.getElementById("globalsearch").focus();
});
</script>
<style lang="scss">