From 9e9dd82b3b91a29a7bcee2062451d40fead32420 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Mon, 27 Nov 2023 10:19:40 -0500 Subject: [PATCH] Change default (not-yet-registered) Panel flex-grow style from 0 to 1 --- .../src/utils/computePanelFlexBoxStyle.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/react-resizable-panels/src/utils/computePanelFlexBoxStyle.ts b/packages/react-resizable-panels/src/utils/computePanelFlexBoxStyle.ts index 705397a2d..188ea722c 100644 --- a/packages/react-resizable-panels/src/utils/computePanelFlexBoxStyle.ts +++ b/packages/react-resizable-panels/src/utils/computePanelFlexBoxStyle.ts @@ -22,9 +22,10 @@ export function computePanelFlexBoxStyle({ let flexGrow; if (panelData.length === 1) { - flexGrow = "100"; + flexGrow = "1"; } else if (size == null) { - flexGrow = "0"; + // Initial render (before panels have registered themselves) + flexGrow = "1"; } else { flexGrow = size.toPrecision(precision); }