mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-04 06:59:41 +00:00
feat: implement global context-aware keyboard shortcuts and modal keyboard support (Enter/Esc)
This commit is contained in:
parent
696961ea4c
commit
791d78884d
7 changed files with 36 additions and 5 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue