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

Dealing with changing heights #28

Closed
nickrttn opened this issue Sep 12, 2019 · 2 comments
Closed

Dealing with changing heights #28

nickrttn opened this issue Sep 12, 2019 · 2 comments

Comments

@nickrttn
Copy link

nickrttn commented Sep 12, 2019

Hi there.

I'm trying to use react-collapsed on an element that has a changing height. Its children are dynamically mounted and only display their content when some data is fetched.

As react-collapsed sets a height in px on the element it is expanding, some of the content that is loading inside that element is being cut off.

From the docs it isn't immediately apparent to me how I make sure that the height of the element is auto after expanding it. Is there any way to do this?

Thanks in advance!

– Nick

@roginfarrer
Copy link
Owner

Hi @nickrttn, can you share a codesandbox or a way to reproduce this? The collapse element should always have its height property stripped after the transition ends (effectively height: auto). If the height of the contents change mid-transition, that's a different issue.

@nickrttn
Copy link
Author

If the height of the contents change mid-transition, that's a different issue.

This is what was happening. I've solved it by loading all content for expandable elements up front.

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

2 participants