mirror of
https://github.com/heyman/heynote.git
synced 2025-06-28 21:41:40 +02:00
Fix issue where Escape key wouldn't work in Note selector when there was text in the input causing no Notes to match
This commit is contained in:
parent
946728060d
commit
74e4c6347b
@ -98,9 +98,21 @@
|
||||
},
|
||||
|
||||
onKeydown(event) {
|
||||
if (event.key === "Escape") {
|
||||
console.log("escape")
|
||||
event.preventDefault()
|
||||
if (this.actionButton !== 0) {
|
||||
this.hideActionButtons()
|
||||
} else {
|
||||
this.$emit("close")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if (this.filteredItems.length === 0) {
|
||||
return
|
||||
}
|
||||
|
||||
const path = this.filteredItems[this.selected].path
|
||||
if (event.key === "ArrowDown") {
|
||||
if (this.selected === this.filteredItems.length - 1) {
|
||||
@ -145,13 +157,6 @@
|
||||
} else {
|
||||
this.selectItem(path)
|
||||
}
|
||||
} else if (event.key === "Escape") {
|
||||
event.preventDefault()
|
||||
if (this.actionButton !== 0) {
|
||||
this.hideActionButtons()
|
||||
} else {
|
||||
this.$emit("close")
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user