Closed Fabioni closed 2 months ago
FWIW, the inline style
prop is not related to the issue you're reporting. Only the inline hitAreaMargins
is because the PanelResizeHandle
re-initializes itself whenever that object changes. I can refine that logic a bit to extract the fine and coarse values, so that it only re-initializes itself when those change though.
Fixed in ae82c4f and released in version 2.0.18. I tested your sandbox to verify that the fix works also.
❤️ → ☕ givebrian.coffee
Please check that sandbox. The problem is in the comments:
https://codesandbox.io/p/sandbox/react-resizable-panels-forked-tz8mc5
It is one of the typical React nightmares. Having the following in the code rerenders
PanelResizeHandle
every time the parent rerenders because the prop referentially changes.Together with
setIsCollapsed(true)
which triggers a rerender of the parent, this breakes the mouse logic of panel resize. Collapse and Expand in the sandbox and you will know what I mean.All together: