react-resize-panel icon indicating copy to clipboard operation
react-resize-panel copied to clipboard

Setting initial panel width

Open dylanhusted opened this issue 5 years ago • 0 comments

Looking at the demo, the panel labeled "right panel with custom handle default 400px" doesn't seem to default to 400px, despite style being set that way here: https://github.com/bjgrosse/react-resize-panel/blob/master/demo/src/App.js#L22

In my case it starts at 395px:

Screenshot from 2020-10-27 16-53-23

In my usage of <ResizePanel />, I'm also seeing my initial width set via the style attribute not being respected.

Looking in the source code, the initial width/height is not being grabbed from props.style, so this behavior does make sense: https://github.com/bjgrosse/react-resize-panel/blob/master/src/ResizePanel.js#L25

That makes this library unusable for a case where I need to start with a 50% width, and let the user resize up or down from there.

Is there something I'm missing here?

Thanks for the library, and I could offer some help here if you're unable to patch this.

dylanhusted avatar Oct 27 '20 20:10 dylanhusted