From fc469ef9c2edc38e95274feb3428e2fc975f5a85 Mon Sep 17 00:00:00 2001 From: Apoorv Mishra Date: Sat, 13 Sep 2025 17:19:03 +0530 Subject: [PATCH] Fix: Deleted image zooms out to `(0, 0)` upon closing Lightbox (#10154) * fix: when the lightbox active image is deleted in editor, it zooms out to (0, 0) upon closing lightbox * Update Lightbox.tsx --------- Co-authored-by: Tom Moor --- app/components/Lightbox.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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,