mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-08 23:58:15 -05:00
only apply keybind when visible
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user