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

"Maximum call stack size exceeded" when passing "display: flex" into "style" #35

Closed
sompylasar opened this issue Feb 9, 2016 · 9 comments
Assignees
Labels

Comments

@sompylasar
Copy link

Just adding display: 'flex' to the style prop of the Collapse causes "Uncaught RangeError: Maximum call stack size exceeded".

From my investigation, the infinite recursion is caused by the setState call in the onHeightReady callback which is called from within a setState callback (from react-height).

Repro: http://codepen.io/anon/pen/WrYBbP?editors=101
Just click "Toggle" on the first example and look into the console.

This may be an issue of react-height or even react itself. I'm not sure what to do with that, so reporting here first.

@nkbt
Copy link
Owner

nkbt commented Feb 9, 2016 via email

@ApurvaB
Copy link

ApurvaB commented Feb 22, 2016

Hi , Is this issue fixed?

@nkbt
Copy link
Owner

nkbt commented Feb 25, 2016

Sorry for holding with this issue.

When container has display: flex height is calculated incorrectly and every step of animation gets "instant height" toggled from 0 to real height. That is not an easy thing to solve - could not get it fixed right away unfortunately and flied away to ReactConf. I am now coming back so hopefully have more time to look at it.

As a quick solution I would suggest to avoid setting flex to Collapse element itself. Set it to either its parent or child node like in here: http://codepen.io/nkbt/pen/ZWzpYN?editors=101
I understand that it might not be a solution in some cases, but "fixing" Collapse behaviour for flex element might not be possible (for current implementation of Collapse).

@nathanmarks
Copy link

@nkbt I ended up getting this error using react-height without react-collapse. Only flex container was numerous levels up.

@nkbt
Copy link
Owner

nkbt commented Apr 6, 2016

Yeah, height is not being properly determined on flex container.

Sorry everyone for the delay with fixing this issue (and other ones). I was working heavily on a backend/devops and did not do any UI work for last ~7 months. Now I am doing UI again and will be able to work on this (well, will have to anyway, as all these UI libs are going to be heavily used). Thanks for your patience and help!

@nathanmarks
Copy link

@nkbt No worries! I appreciate the work -- it has helped me figure out my own basic solution that seems to be working (so far 😄 ) for my current use case: https://github.com/nathanmarks/material-ui/blob/stepper-updates/src/internal/ExpandTransitionChild.js

@nkbt
Copy link
Owner

nkbt commented Apr 6, 2016

Cool 👌

@nkbt
Copy link
Owner

nkbt commented Aug 11, 2016

Closing, most likely will be fixed by #72
Hard to tell since I cannot reproduce this anymore

@nkbt nkbt closed this as completed Aug 11, 2016
@nkbt nkbt reopened this Aug 11, 2016
@nkbt
Copy link
Owner

nkbt commented Aug 11, 2016

Will add an example case...

@nkbt nkbt self-assigned this Aug 11, 2016
@nkbt nkbt mentioned this issue Aug 11, 2016
12 tasks
@nkbt nkbt closed this as completed Apr 18, 2017
@nkbt nkbt removed the in progress label Apr 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants