mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-22 16:19:53 +05:30
handlers.js: fix TypeError on document.activeElement.type
This commit is contained in:
parent
3c882cff6e
commit
b344e1aadb
@ -150,13 +150,13 @@
|
||||
|
||||
// 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)$/;
|
||||
const allowed = /^(button|checkbox|file|radio|submit)$/;
|
||||
|
||||
if (focused_tag === "textarea" ||
|
||||
(focused_tag === "input" && !focused_type.match(allowed))
|
||||
)
|
||||
return;
|
||||
if (focused_tag === "textarea") return;
|
||||
if (focused_tag === "input") {
|
||||
let focused_type = document.activeElement.type.toLowerCase();
|
||||
if (!focused_type.match(allowed)) return;
|
||||
}
|
||||
|
||||
// Focus search bar on '/'
|
||||
if (event.key == "/") {
|
||||
|
Loading…
Reference in New Issue
Block a user