X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/8cd6c797e8a1b80de01bf0ddc0645e3c4765ff5e..4630f0728225dbbfca285bd88345a678cf8d02d1:/resources/js/components/shortcuts.js diff --git a/resources/js/components/shortcuts.js b/resources/js/components/shortcuts.js index 1d5bd51d7..8bf26fbb5 100644 --- a/resources/js/components/shortcuts.js +++ b/resources/js/components/shortcuts.js @@ -25,21 +25,20 @@ export class Shortcuts extends Component { setupListeners() { window.addEventListener('keydown', event => { - if (event.target.closest('input, select, textarea')) { + if (event.target.closest('input, select, textarea, .cm-editor, .editor-container')) { return; } - this.handleShortcutPress(event); - }); - - window.addEventListener('keydown', event => { if (event.key === '?') { if (this.hintsShowing) { this.hideHints(); } else { this.showHints(); } + return; } + + this.handleShortcutPress(event); }); }