feat: implement global context-aware keyboard shortcuts and modal keyboard support (Enter/Esc)

This commit is contained in:
Tiberiu Ichim 2026-02-20 18:28:37 +02:00
parent 696961ea4c
commit 791d78884d
7 changed files with 36 additions and 5 deletions

View file

@ -108,6 +108,13 @@ export default {
if (this.$store.state.innerModalOpen) return
if (action === this.$hotkeys.Modal.CLOSE) {
this.show = false
} else if (action === this.$hotkeys.Modal.SUBMIT) {
const activeElement = document.activeElement
// Don't submit if we are in a textarea or certain inputs
if (activeElement && ['TEXTAREA'].includes(activeElement.tagName)) {
return
}
this.$emit('submit')
}
},
setShow() {