]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/shortcuts.js
Opensearch: Fixed XML declaration when php short tags enabled
[bookstack] / resources / js / components / shortcuts.js
index 1d5bd51d7849a1b57c107b45802d90daf2fcbc38..8bf26fbb51c1a680587eaf89f348f90853ea7ea6 100644 (file)
@@ -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);
         });
     }