Skip to content

[Breaking Change] Panel CSS changed from width/height: 100% to flex-grow: 1 in v4.5.x - breaks existing layouts #631

@jonathan-pyt

Description

@jonathan-pyt

Description

After upgrading from 4.4.1 to 4.5.2, existing layouts are broken due to an undocumented CSS change in the <Panel> component.

Breaking Change

Before (v4.4.1)

The div generated by <Panel> had:

width: 100%;
height: 100%;

After (v4.5.2)

The div generated by <Panel> now has:

flex-grow: 1;

Impact

This change breaks layouts where child components relied on the panel having explicit width: 100% and height: 100%. Children no longer stretch to fill the available space as expected.

Reproduction

<Group orientation="horizontal">
  <Panel id="main">{children}</Panel>
  <ResizeHandle />
  <Panel id="sidebar" minSize="300px">
    <Sidebar />
  </Panel>
</Group>

In v4.4.1, {children} would fill the entire panel space.
In v4.5.2, {children} may not fill the space correctly depending on their CSS.

Request

  1. Document this breaking change in the changelog/release notes
  2. Consider adding a migration guide for users upgrading from v4.4.x to v4.5.x
  3. Clarify if this change was intentional and the reasoning behind it

Environment

  • react-resizable-panels: upgraded from 4.4.1 to 4.5.2
  • React: 18.x

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions