1
Fork 0

main.js: handle document.activeElement being null

this is technically possible if someone sticks rustdoc in
an iframe, i think?
This commit is contained in:
binarycat 2025-03-10 13:54:02 -05:00
parent f5efd2aba3
commit ab180c29e3

View file

@ -538,8 +538,8 @@ function preLoadCss(cssUrl) {
return;
}
// @ts-expect-error
if (document.activeElement.tagName === "INPUT" &&
if (document.activeElement &&
document.activeElement.tagName === "INPUT" &&
// @ts-expect-error
document.activeElement.type !== "checkbox" &&
// @ts-expect-error