-
-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Panels break when changing minSize #142
Comments
Give the panels an explicit <PanelGroup direction="horizontal">
<Panel minSize={minSize} order={0}>
<Block />
</Panel>
<PanelResizeHandle>
<Block style={{ width: 2, marginLeft: 4, marginRight: 4 }} />
</PanelResizeHandle>
<Panel order={1}>
<Block />
</Panel>
</PanelGroup>; https://codesandbox.io/s/react-resizable-panels-issues-142-forked-d164kg |
Hmm, the documentation states that the Is the |
There are other props that- when changed, require a Panel to retegister itself with the PanelGroup- which can cause issues with how the resize handle works (it is associated based on registration order- not visual location on the screen, since there’s no way to know that) To be clear, this library (at least the docs) could do better here- but for now you can fix the issue you’re reporting by adding an “order” prop |
I think I've made a change that will reduce the likelihood of cases like this. (Basically passing a ref rather than the actual panel– so a panel only needs to register/unregister when it mounts/unmounts.) |
Avoid re-registering Panel when props change
0.0.44 should be better in this regard |
Confirmed that the issue doesn't appear with 0.0.44! Thanks!! |
Thanks for confirming! I'm glad to hear it. |
Just as additional information: I was having trouble with Thanks for the great lib! |
Hey! Thanks for this amazing package :-)
I tried to implement the trick that allows you to set a minSize based on pixels (from your comment #48 (comment)).
However, if I change the minSize, something strange happens. The resize handler starts to work the exact opposite way.
I have made a CodeSandbox example to demonstrate what I mean:
https://codesandbox.io/s/react-resizable-panels-issues-142-vgekmz
Everything works nicely, until the Break! button is clicked. I don't understand how or why.. looks like a bug?
The text was updated successfully, but these errors were encountered: