mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 13:03:02 +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 useShortcuts from "@/composables/useKeyboard";
|
||||||
import Logo from "@/components/Logo.vue";
|
import Logo from "@/components/Logo.vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
import { onStartTyping } from "@vueuse/core";
|
||||||
|
|
||||||
const context_store = useContextStore();
|
const context_store = useContextStore();
|
||||||
const queue = useQStore();
|
const queue = useQStore();
|
||||||
@@ -53,6 +54,10 @@ app_dom.addEventListener("click", (e) => {
|
|||||||
useRouter().afterEach(() => {
|
useRouter().afterEach(() => {
|
||||||
document.getElementById("acontent")?.scrollTo(0, 0);
|
document.getElementById("acontent")?.scrollTo(0, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onStartTyping(() => {
|
||||||
|
document.getElementById("globalsearch").focus();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<div id="ginner" tabindex="0">
|
<div id="ginner" tabindex="0">
|
||||||
<div class="icon image"></div>
|
<div class="icon image"></div>
|
||||||
<input
|
<input
|
||||||
id="search"
|
id="globalsearch"
|
||||||
class="rounded"
|
class="rounded"
|
||||||
v-model="search.query"
|
v-model="search.query"
|
||||||
placeholder="Search your library"
|
placeholder="Search your library"
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { ref } from "vue";
|
||||||
import useSearchStore from "../../stores/search";
|
import useSearchStore from "../../stores/search";
|
||||||
|
|
||||||
const search = useSearchStore();
|
const search = useSearchStore();
|
||||||
|
|||||||
Reference in New Issue
Block a user