Invidious is an alternative front-end to YouTube
Ignore "/" key handling if search box is focused
Samantaz Fox15c66e2b01ca
diff --git a/assets/js/handlers.js b/assets/js/handlers.jsindex a417fcca..d3957b89 100644--- a/assets/js/handlers.js+++ b/assets/js/handlers.js@@ -146,7 +146,17 @@// Handle keypresseswindow.addEventListener('keydown', (event) => {// Ignore modifier keys- if (event.ctrlKey || event.metaKey) { return; }+ if (event.ctrlKey || event.metaKey) return;++ // Ignore shortcuts if any text input is focused+ let focused_tag = document.activeElement.tagName.toLowerCase();+ let focused_type = document.activeElement.type.toLowerCase();+ let allowed = /^(button|checkbox|file|radio|submit)$/;++ if (focused_tag === "textarea" ||+ (focused_tag === "input" && !focused_type.match(allowed))+ )+ return;// Focus search bar on '/'if (event.key == "/") {