shortcut for focusing on cateogry chooser

practiced-songs
Matthew Huntington 7 months ago
parent bfc4e0c29f
commit 225c9d5e20

@ -1,5 +1,5 @@
<script setup>
import { defineProps } from 'vue';
import { onMounted, defineProps, ref } from 'vue';
import {
currentWorkingCategory,
@ -12,9 +12,21 @@
currentWorkingCategory.value = categories.value.find(category => category.instrument === currentWorkingInstrument.value.name)
}
const categoryInput = ref(null)
onMounted(()=>{
window.addEventListener('keydown', (event)=>{
if(event.ctrlKey === true){
if(event.key === 'c') {
categoryInput.value.focus();
}
}
})
})
</script>
<template>
<select @change="selectFirstInstrumentOfCategory" v-model="currentWorkingInstrument">
<select ref="categoryInput" @change="selectFirstInstrumentOfCategory" v-model="currentWorkingInstrument">
<option :value="instrument" v-for="instrument in instruments">
{{instrument.name}}
</option>

Loading…
Cancel
Save