diff --git a/app/components/Lightbox.tsx b/app/components/Lightbox.tsx index 8af779f079..9c0272b02c 100644 --- a/app/components/Lightbox.tsx +++ b/app/components/Lightbox.tsx @@ -291,7 +291,7 @@ function Lightbox({ onUpdate, activePos }: Props) { // in editor const editorImageEl = imageElements[currentImageIndex]; let to; - if (editorImageEl) { + if (editorImageEl?.isConnected) { const editorImgDOMRect = editorImageEl.getBoundingClientRect(); const { top: editorImgTop,