Skip to content

Commit

Permalink
Made PanelGroup bailout condition smarter
Browse files Browse the repository at this point in the history
  • Loading branch information
bvaughn committed Nov 18, 2023
1 parent 4829fe8 commit c1a1c48
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/react-resizable-panels/src/PanelGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,14 @@ function PanelGroupWithForwardedRef({

const groupSizePixels = calculateAvailablePanelSizeInPixels(groupId);
if (groupSizePixels <= 0) {
// Wait until the group has rendered a non-zero size before computing layout.
return;
if (
shouldMonitorPixelBasedConstraints(
panelDataArray.map(({ constraints }) => constraints)
)
) {
// Wait until the group has rendered a non-zero size before computing layout.
return;
}
}

if (unsafeLayout == null) {
Expand Down

0 comments on commit c1a1c48

Please sign in to comment.