diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.ts index 3abc55c07..6b4daef7c 100644 --- a/app/src/layout/Wnd.ts +++ b/app/src/layout/Wnd.ts @@ -332,7 +332,6 @@ export class Wnd { return; } - if (targetWndElement.contains(document.querySelector(`[data-id="${tabId}"]`))) { return; } diff --git a/app/src/protyle/util/hasClosest.ts b/app/src/protyle/util/hasClosest.ts index a650eebb9..a8b1aa760 100644 --- a/app/src/protyle/util/hasClosest.ts +++ b/app/src/protyle/util/hasClosest.ts @@ -120,7 +120,7 @@ export const hasClosestByClassName = (element: Node, className: string, top = fa let e = element as HTMLElement; let isClosest = false; while (e && !isClosest && (top ? e.tagName !== "BODY" : !e.classList.contains("protyle-wysiwyg"))) { - if (e.classList.contains(className)) { + if (e.classList?.contains(className)) { isClosest = true; } else { e = e.parentElement; diff --git a/app/src/window/setHeader.ts b/app/src/window/setHeader.ts index c954b7e88..fea887d42 100644 --- a/app/src/window/setHeader.ts +++ b/app/src/window/setHeader.ts @@ -23,7 +23,7 @@ export const setTabPosition = () => { const headerElement = item.headersElement.parentElement; const rect = headerElement.getBoundingClientRect() const dragElement = headerElement.querySelector('.item--readonly .fn__flex-1') as HTMLElement - if (rect.top === 0) { + if (rect.top <= 0) { dragElement.style.height = dragElement.parentElement.clientHeight + "px" // @ts-ignore dragElement.style.WebkitAppRegion = "drag";