hipstersmoothie / react-window-splitter

react-resizable-grid-panels
https://react-window-splitter-six.vercel.app
50 stars 2 forks source link

The Panel default prop doesn't set a size #13

Closed matt-aitken closed 3 months ago

matt-aitken commented 3 months ago

Situation

If you set default="100px" on a Panel it doesn't make it 100px wide.

Example:

<PanelGroup style={{ height: "400px" }}>
  <Panel id="left" style={{ backgroundColor: "#333366" }} />
  <PanelResizer id="handle" size="3px" />
  {/* I expected the right panel to be 100px wide */}
  <Panel
    id="right"
    default="100px"
    style={{ backgroundColor: "#ff3366" }}
  />
</PanelGroup>

CleanShot 2024-08-12 at 16 01 26@2x

Expectation

That the right panel would be 100px wide and the left would take up the remaining space. I want to have a layout where the right-panel is an inspector and the rest of the space is taken up by the left. I will probably add min and max widths too but possibly not. With a min, max and default the width starts at the max.

Reproduction

This CodeSandbox has the code above: https://codesandbox.io/p/sandbox/great-estrela-dcsz7w

hipstersmoothie commented 3 months ago

:rocket: Issue was released in v0.2.1 :rocket:

hipstersmoothie commented 3 months ago

New version has a bunch of bugs fixed!