only apply keybind when visible

This commit is contained in:
vabene1111
2024-03-06 20:29:41 +01:00
parent 73ba5a591d
commit cf20b22404

View File

@@ -128,6 +128,7 @@ export default defineComponent({
mounted() { mounted() {
// add keyhandlers // add keyhandlers
window.addEventListener('keydown', (e) => { window.addEventListener('keydown', (e) => {
if (this.dialog) {
if (e.key == 'ArrowUp') { if (e.key == 'ArrowUp') {
this.selected_result = Math.max(0, this.selected_result - 1) this.selected_result = Math.max(0, this.selected_result - 1)
} }
@@ -141,6 +142,7 @@ export default defineComponent({
this.dialog = true this.dialog = true
e.preventDefault() e.preventDefault()
} }
}
}) })
const api = new ApiApi() const api = new ApiApi()