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
When I collapse, if I don't have an onCollapse callback, the panel is being correctly collapsed to the size specified in collapseOptions.collapseSize. However, if I add the onCollapse callback, it's now being incorrectly collapsed.
I tried to log the sizes array passed to onCollapse. sizes[collapsedIdx] it's not the collapseSize, and it's not consistent either. Did it take the value from before the animation is finished?
For my specific case, I tried checking if sizes[collapsedIdx] is null. If it's not, I'm manually constructing a new array for the state. However I think this causes an infinite loop that I haven't been able to figure out where, and everything freezes.
---- Edit:
With further debugging, I think it's the width calculation returned incorrect result.
After some container resize, the flex-basis of all children doesn't add up to the container size.
One fix is to make the collapsed children has a flex-grow of 0. I have created a PR #80
The text was updated successfully, but these errors were encountered:
godsamit
changed the title
onCollapse callback has conflict with collapseSize prop
Inaccurate width calculation on browser resize
Jul 3, 2021
godsamit
changed the title
Inaccurate width calculation on browser resize
Inaccurate width calculation for panes on container resize
Jul 3, 2021
When I collapse, if I don't have an
onCollapse
callback, the panel is being correctly collapsed to the size specified incollapseOptions.collapseSize
. However, if I add theonCollapse
callback, it's now being incorrectly collapsed.I tried to log the
sizes
array passed toonCollapse
.sizes[collapsedIdx]
it's not thecollapseSize
, and it's not consistent either. Did it take the value from before the animation is finished?For my specific case, I tried checking if
sizes[collapsedIdx]
is null. If it's not, I'm manually constructing a new array for the state. However I think this causes an infinite loop that I haven't been able to figure out where, and everything freezes.---- Edit:
With further debugging, I think it's the width calculation returned incorrect result.
After some container resize, the flex-basis of all children doesn't add up to the container size.
One fix is to make the collapsed children has a flex-grow of 0. I have created a PR #80
The text was updated successfully, but these errors were encountered: