handlers.js: fix TypeError on document.activeElement.type

このコミットが含まれているのは:
Samantaz Fox 2022-02-08 00:04:02 +01:00
コミット b344e1aadb
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: F42821059186176E
1個のファイルの変更6行の追加6行の削除

ファイルの表示

@ -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 == "/") {