Closed psychedelicious closed 10 months ago
Thanks for the repro.
Here's a Replay I made of the repro you shared: https://app.replay.io/recording/6c38db67-2a7a-4736-9a34-f8fb9772d9b6
I'll look into it and add some comments there.
Np. Do you mind making the replay public?
Ooops. My apologies. it's public now.
Thanks for the bug report. I think #215 should fix this (and a few other issues I discovered while testing).
react-resizable-panels@0.0.58 has been published with this fix
v57 Repro: https://codesandbox.io/p/sandbox/erroneous-collapse-on-window-resize-lhdnc4
Resize the window, making it smaller horizontally. The panels collapse immediately, despite there being plenty of room for them.
In this example, I've made the min and max sizes the same to make the issue very obvious, but the same behaviour occurs when they are different - you just need to shrink the window down a bit more.
I added a resizeobserver to the panel content, logging the width to console. It appears that for a brief moment during a calculation during window resizing, the panel's width dips below its
minSizePixels
, triggering the collapse.