From 1fc2681882391ba6cfe4fbae6a7c5292ef7373d5 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Thu, 5 Jan 2023 10:08:07 -0500 Subject: [PATCH 1/2] Disable pointer events during resize --- packages/react-resizable-panels/src/PanelGroup.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/react-resizable-panels/src/PanelGroup.ts b/packages/react-resizable-panels/src/PanelGroup.ts index fe332e767..770ae5712 100644 --- a/packages/react-resizable-panels/src/PanelGroup.ts +++ b/packages/react-resizable-panels/src/PanelGroup.ts @@ -196,9 +196,13 @@ export function PanelGroup({ // Without this, Panel sizes may be unintentionally overridden by their content. overflow: "hidden", + + // Disable pointer events inside of a panel during resize. + // This avoid edge cases like nested iframes. + pointerEvents: activeHandleId !== null ? "none" : undefined, }; }, - [direction, sizes] + [activeHandleId, direction, sizes] ); const registerPanel = useCallback((id: string, panel: PanelData) => { From 4cac9e6846a0e04d33ce57ee179ac76c5c7c7e9f Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Thu, 5 Jan 2023 10:08:41 -0500 Subject: [PATCH 2/2] CHANGELOG --- packages/react-resizable-panels/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-resizable-panels/CHANGELOG.md b/packages/react-resizable-panels/CHANGELOG.md index 2cd1642e4..0bb33eb42 100644 --- a/packages/react-resizable-panels/CHANGELOG.md +++ b/packages/react-resizable-panels/CHANGELOG.md @@ -2,6 +2,7 @@ ## 0.0.29 * [#58](https://github.com/bvaughn/react-resizable-panels/pull/58): Add imperative `collapse`, `expand`, and `resize` methods to `Panel`. +* [#64](https://github.com/bvaughn/react-resizable-panels/pull/64): Disable `pointer-events` inside of `Panel`s during resize. This avoid edge cases like nested iframes. * [#57](https://github.com/bvaughn/react-resizable-panels/pull/57): Improve server rendering check to include `window.document`. This more closely matches React's own check and avoids false positives for environments that alias `window` to some global object. ## 0.0.28