From fe9b677c96766a0e526ed827ce8a89a06f5ff17b Mon Sep 17 00:00:00 2001 From: Arthur Neuman Date: Sat, 28 Sep 2024 09:55:39 -0400 Subject: [PATCH] Before stack comparison, check if target element is in document (#410) --- 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) &&