-
-
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
Panel onResize not called if there is no onLayout #161
Conversation
For the initial render, if the layout is restored from local storage, the Panel's `onResize` function is only called if the PanelGroup has a `onLayout`.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Formatting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Published as 0.0.52! |
I think that either this PR or the ordering change of
I tried updating to this version in Replay (replayio/devtools#9381) and here is a recording of a failed end to end test: Edit 1: Fortunately I'm able to run the test locally and reproduce the failure. Reverting this PR fixes the bug, so it does seem to be related to this change rather than a87cdb6. Adding some logging to my local build of resizable panels shows that the Edit 2: I think the problem is that the panel refs are stored in state: const [panels, setPanels] = useState<PanelDataMap>(new Map()); Each Maybe it's possible to remove registered panels from state and just store them in a mutable ref. Edit 3: This is trickier than I thought it was going to be. Storing panels in state seems to be important since sometimes re-renders are needed to call effects after changes. I also tried mutating the committed values in the I'm not sure how to fix this. Edit 4: I think I have found a workaround: 3bf394a |
Woa, nice work tracking that down. Sorry this PR introduced that issue! |
No worries
…On Sun, Jun 25, 2023 at 2:17 PM Rijk van Wel ***@***.***> wrote:
Woa, nice work tracking that down. Sorry this PR introduced that issue!
—
Reply to this email directly, view it on GitHub
<#161 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAHHHIDQX6KIUYHBZLCRYLXNB6E5ANCNFSM6AAAAAAZQIH36Y>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
For the initial render, if the layout is restored from local storage, the Panel's
onResize
function is only called if the PanelGroup has aonLayout
. This is not expected and I assume was not intentional?In this PR I just removed the
if (onLayout)
check in favor of aonLayout?.(sizes)
later on.