Skip to content
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

Inaccurate width calculation for panes on container resize #78

Open
godsamit opened this issue Jul 3, 2021 · 0 comments
Open

Inaccurate width calculation for panes on container resize #78

godsamit opened this issue Jul 3, 2021 · 0 comments

Comments

@godsamit
Copy link

godsamit commented Jul 3, 2021

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

@godsamit godsamit changed the title onCollapse callback has conflict with collapseSize prop Inaccurate width calculation on browser resize Jul 3, 2021
@godsamit godsamit changed the title Inaccurate width calculation on browser resize Inaccurate width calculation for panes on container resize Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant