]> BookStack Code Mirror - bookstack/commitdiff
Shortcuts: Prevented help shown when in inputs
authorDan Brown <redacted>
Mon, 23 Oct 2023 10:04:09 +0000 (11:04 +0100)
committerDan Brown <redacted>
Mon, 23 Oct 2023 10:04:09 +0000 (11:04 +0100)
For #4606

resources/js/components/shortcuts.js

index 85a7c3da711a1bf6bedca3760c69065982eefcaf..b22c467318e73f383259119d5b96126b8e39c98f 100644 (file)
@@ -29,17 +29,16 @@ export class Shortcuts extends Component {
                 return;
             }
 
-            this.handleShortcutPress(event);
-        });
-
-        window.addEventListener('keydown', event => {
             if (event.key === '?') {
                 if (this.hintsShowing) {
                     this.hideHints();
                 } else {
                     this.showHints();
                 }
+                return;
             }
+
+            this.handleShortcutPress(event);
         });
     }