You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been developing a view with 3 panels, all of them to collapse at the same minSize and to call a function onCollapse and another function onExpand. I have added the collapsedSize, so that the collapsed panel will have a specific width (48px). This specific width is calculated in a useEffect on render and set to a variable that then I pass to the panels.
When I resize a panel, the panel's width gets set to the collapsedSize, but the onCollapse function does not get called, I have tested setting the collapsedSize as an actual number (for example, collapsedSize={5}) and the onCollapse function works. But it doesn't when the collapsedSize is set through the variable (collapsedSize={collapsedSizeVariable}).
The collapsedSizeVariable gets calculated in the following way:
useEffect(() => {
const windowWidth = window.innerWidth;
if (windowWidth) {
// collapsedSize to be 48px
setCollapsedSizeVariable((48 * 100) / windowWidth);
}
}, []);
Any advice about how to get around this issue?
Br
The text was updated successfully, but these errors were encountered:
I was preparing the a simplified repo for sharing with you and the error did not happen. I started my component anew all the way to its most complex version and I have been able to fix the issue somehow; still need to investigate where the error was coming from.
But for sure it was not a problem with your library! Thanks for your attention!
Hi,
I have been developing a view with 3 panels, all of them to collapse at the same minSize and to call a function onCollapse and another function onExpand. I have added the collapsedSize, so that the collapsed panel will have a specific width (48px). This specific width is calculated in a useEffect on render and set to a variable that then I pass to the panels.
When I resize a panel, the panel's width gets set to the collapsedSize, but the onCollapse function does not get called, I have tested setting the collapsedSize as an actual number (for example, collapsedSize={5}) and the onCollapse function works. But it doesn't when the collapsedSize is set through the variable (collapsedSize={collapsedSizeVariable}).
The collapsedSizeVariable gets calculated in the following way:
Any advice about how to get around this issue?
Br
The text was updated successfully, but these errors were encountered: