1
0
forked from mirror/misskey
This commit is contained in:
kakkokari-gtyih 2024-07-09 23:27:40 +09:00
parent 8f602b7656
commit 2a9b8dc25c

View File

@ -14,7 +14,7 @@ function containsFocusTrappedElements(el: HTMLElement): boolean {
function releaseFocusTrap(el: HTMLElement): void { function releaseFocusTrap(el: HTMLElement): void {
focusTrapElements.delete(el); focusTrapElements.delete(el);
if (el.parentElement && el.parentElement !== document.body) { if (el.parentElement != null && el !== document.body) {
el.parentElement.childNodes.forEach((siblingNode) => { el.parentElement.childNodes.forEach((siblingNode) => {
const siblingEl = getHTMLElementOrNull(siblingNode); const siblingEl = getHTMLElementOrNull(siblingNode);
if (!siblingEl) return; if (!siblingEl) return;
@ -29,7 +29,7 @@ function releaseFocusTrap(el: HTMLElement): void {
} }
export function focusTrap(el: HTMLElement): { release: () => void; } { export function focusTrap(el: HTMLElement): { release: () => void; } {
if (el.parentElement && el.parentElement !== document.body) { if (el.parentElement != null && el !== document.body) {
el.parentElement.childNodes.forEach((siblingNode) => { el.parentElement.childNodes.forEach((siblingNode) => {
const siblingEl = getHTMLElementOrNull(siblingNode); const siblingEl = getHTMLElementOrNull(siblingNode);
if (!siblingEl) return; if (!siblingEl) return;