X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/8846f7d255d9d2f9d6b997d57aff9a511074796f..refs/pull/5280/head:/resources/js/components/shortcuts.js diff --git a/resources/js/components/shortcuts.js b/resources/js/components/shortcuts.js index 85a7c3da7..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, .cm-editor')) { + 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); }); }