Summary
I'm not reporting a bug — I'm looking for guidance on how to achieve
a specific resize behavior when the container size changes dynamically.
Use Case
I have a chat-like layout with two panels stacked vertically:
- Panel A (input box): has
minSize and maxSize constraints,
and can be manually resized by the user via a resize handle
- Panel B (conversation area): no size constraints
<PanelGroup direction="vertical">
<Panel>
Panel B (conversation area)
</Panel>
<PanelResizeHandle />
<Panel minSize={100} maxSize={200}>
Panel A (input box)
</Panel>
</PanelGroup>
Current Behavior
When the container shrinks:
- Panel A and Panel B shrink proportionally ✅
- Once Panel A hits
minSize, only Panel B continues to shrink ✅
When the container grows back:
3. Panel A and Panel B both grow proportionally ❌
Expected Behavior
When the container grows back after Panel A has hit minSize:
3. Panel A should stay at minSize and remain unchanged
4. Only Panel B should grow to fill the extra space ✅
In other words, once Panel A has been "pinned" to its minSize due to
container shrinking, it should not automatically expand when the
container grows back — only Panel B should absorb the new space.
Real-World Scenario
This happens in practice when using browser DevTools:
- Open DevTools docked to the bottom → container height shrinks
- Panel A (input box) hits
minSize and stops shrinking
- Panel B (conversation area) continues to shrink ✅
- Close DevTools → container height grows back
- Both panels grow proportionally, causing Panel A (input box)
to become disproportionately large again ❌
The user had previously manually resized Panel A to a comfortable
height. After the DevTools open/close cycle, Panel A is no longer
at the user's preferred size, which is a poor UX.
What I've Tried / What I'm Looking For
Is there a recommended way to achieve this behavior?
For example:
- Listening to a "panel hit minSize" event and locking Panel A's size?
- Using
onLayout to detect and manually correct the layout after
the container grows?
- Setting
imperative panel ref to programmatically fix Panel A's
size once it hits minSize?
Any guidance or workaround would be greatly appreciated!
Summary
I'm not reporting a bug — I'm looking for guidance on how to achieve
a specific resize behavior when the container size changes dynamically.
Use Case
I have a chat-like layout with two panels stacked vertically:
minSizeandmaxSizeconstraints,and can be manually resized by the user via a resize handle
Current Behavior
When the container shrinks:
minSize, only Panel B continues to shrink ✅When the container grows back:
3. Panel A and Panel B both grow proportionally ❌
Expected Behavior
When the container grows back after Panel A has hit
minSize:3. Panel A should stay at
minSizeand remain unchanged4. Only Panel B should grow to fill the extra space ✅
In other words, once Panel A has been "pinned" to its
minSizedue tocontainer shrinking, it should not automatically expand when the
container grows back — only Panel B should absorb the new space.
Real-World Scenario
This happens in practice when using browser DevTools:
minSizeand stops shrinkingto become disproportionately large again ❌
The user had previously manually resized Panel A to a comfortable
height. After the DevTools open/close cycle, Panel A is no longer
at the user's preferred size, which is a poor UX.
What I've Tried / What I'm Looking For
Is there a recommended way to achieve this behavior?
For example:
onLayoutto detect and manually correct the layout afterthe container grows?
imperativepanel ref to programmatically fix Panel A'ssize once it hits
minSize?Any guidance or workaround would be greatly appreciated!