diff --git a/src/components/NoteSelector.vue b/src/components/NoteSelector.vue index 1bbe95a..ca63783 100644 --- a/src/components/NoteSelector.vue +++ b/src/components/NoteSelector.vue @@ -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") - } } },