X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/607da7310925087bba93fd5b178739e5a2be7c66..refs/pull/5625/head:/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); }); }