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.
2 parents 49edf0e + 15c66e2 commit 2289f98Copy full SHA for 2289f98
assets/js/handlers.js
@@ -146,7 +146,17 @@
146
// Handle keypresses
147
window.addEventListener('keydown', (event) => {
148
// Ignore modifier keys
149
- if (event.ctrlKey || event.metaKey) { return; }
+ if (event.ctrlKey || event.metaKey) return;
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)$/;
155
156
+ if (focused_tag === "textarea" ||
157
+ (focused_tag === "input" && !focused_type.match(allowed))
158
+ )
159
+ return;
160
161
// Focus search bar on '/'
162
if (event.key == "/") {
0 commit comments