mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 04:23:01 +00:00
drop in onStartTyping to focus on search bar automatically
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div id="ginner" tabindex="0">
|
||||
<div class="icon image"></div>
|
||||
<input
|
||||
id="search"
|
||||
id="globalsearch"
|
||||
class="rounded"
|
||||
v-model="search.query"
|
||||
placeholder="Search your library"
|
||||
@@ -16,6 +16,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import useSearchStore from "../../stores/search";
|
||||
|
||||
const search = useSearchStore();
|
||||
|
||||
Reference in New Issue
Block a user