We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c882cf commit b344e1aCopy full SHA for b344e1a
assets/js/handlers.js
@@ -150,13 +150,13 @@
150
151
// Ignore shortcuts if any text input is focused
152
let focused_tag = document.activeElement.tagName.toLowerCase();
153
- let focused_type = document.activeElement.type.toLowerCase();
154
- let allowed = /^(button|checkbox|file|radio|submit)$/;
+ const allowed = /^(button|checkbox|file|radio|submit)$/;
155
156
- if (focused_tag === "textarea" ||
157
- (focused_tag === "input" && !focused_type.match(allowed))
158
- )
159
- return;
+ if (focused_tag === "textarea") return;
+ if (focused_tag === "input") {
+ let focused_type = document.activeElement.type.toLowerCase();
+ if (!focused_type.match(allowed)) return;
+ }
160
161
// Focus search bar on '/'
162
if (event.key == "/") {
0 commit comments