From 999055aa2306f53fba3461dc8874c64c59c79fcb Mon Sep 17 00:00:00 2001 From: Arthur Neuman Date: Sun, 22 Sep 2024 18:13:05 -0700 Subject: [PATCH] Before stack comparison, check if target element is in document --- packages/react-resizable-panels/src/PanelResizeHandleRegistry.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-resizable-panels/src/PanelResizeHandleRegistry.ts b/packages/react-resizable-panels/src/PanelResizeHandleRegistry.ts index d19c7abe..f591e4df 100644 --- a/packages/react-resizable-panels/src/PanelResizeHandleRegistry.ts +++ b/packages/react-resizable-panels/src/PanelResizeHandleRegistry.ts @@ -197,6 +197,7 @@ function recalculateIntersectingHandles({ // and the element that was actually clicked/touched if ( targetElement !== null && + document.contains(targetElement) && dragHandleElement !== targetElement && !dragHandleElement.contains(targetElement) && !targetElement.contains(dragHandleElement) &&