Skip to content

Commit

Permalink
Wait until the group has rendered a non-zero size before computing la…
Browse files Browse the repository at this point in the history
…yout
  • Loading branch information
bvaughn committed Nov 13, 2023
1 parent 715ab01 commit 0ea090a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react-resizable-panels/src/PanelGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ function PanelGroupWithForwardedRef({
}

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

if (unsafeLayout == null) {
unsafeLayout = calculateUnsafeDefaultLayout({
Expand Down

0 comments on commit 0ea090a

Please sign in to comment.