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

change default prop for height, set to inherit #582

Merged
merged 1 commit into from
Sep 13, 2019

Conversation

sarmeyer
Copy link
Member

@sarmeyer sarmeyer commented Sep 4, 2019

Another effort to get to the bottom of this height/resizing issue! Instead of having the user have to pass in a height prop to the Carousel, or set an explicit height style property on the Carousel or its wrapper, setting the default prop to 'inherit' allows the Carousel to take on the height of its contents. Previously, it was set to 'auto' and it was not inheriting the height value of it's children until a resize event was fired or the slide was changed.

I tested this by providing a {height: inherit} style property to this codesandbox https://codesandbox.io/s/sad-solomon-gwd10 and did not see the resizing issue. When height was set to auto, the issue persisted.

@YLemelin09
Copy link

YLemelin09 commented Sep 4, 2019

So the height inherit is by default as in <carousel height='inherit' /> and not <carousel style={{height:'inherit'}} /> right?

@sarmeyer
Copy link
Member Author

sarmeyer commented Sep 4, 2019

@YLemelin09 unless a height prop with a different value is assigned to the Carousel, or a height style property is applied to the Carousel manually or by way of a wrapper element. it is essentially the same thing as <Carousel style={{height:'inherit'}} />

@sarmeyer sarmeyer merged commit 957ff52 into master Sep 13, 2019
@malcalevak
Copy link

@sarmeyer is https://codesandbox.io/s/sad-solomon-gwd10 not supposed to exhibit the issue? If so, I'd check again in an incognito/private window, as it's still exhibiting the issue. Let me know if I'm completely misunderstanding.

@sarmeyer sarmeyer deleted the change-default-height-prop branch November 5, 2019 00:34
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

Successfully merging this pull request may close these issues.

3 participants