Slide Height
It seems like as if the height of the slide is the height of the largest slide. Is there a way to specify the slide's height? Or an option in props we can set so all of the slides conform to the height of its contents? Otherwise, I'd like to request such an option.
+1
+1
+1
+1
How would you want this to work, exactly?
Currently the whole carousel has the height of its tallest slide. If there was a prop called fixedHeight, that would be true. For those who want there to be a variable height, something like <Carousel fixedHeight={false}>?
The issue is if you have items in carousel with different heights, than because of height of its tallest child, there is huge gap between smallest and largest child, fixedHeight prop would be nice, but all we need is to set carousel height based on current slide, not tallest one
+1
+1. It should work like wrote @Zetberg
+1
+1
+1 Current not-so-pretty solution:
afterSlide (currentSlide) {
const list = window.document.querySelector('.slider-list');
const nextSlide = list.childNodes[currentSlide];
list.style.height = nextSlide.offsetHeight + 'px';
}
render() {
...
<Carousel decorators={decorators} afterSlide={this.afterSlide}>
...
}
no news here? @kenwheeler
@mdaxtman
I'll get to work on this tomorrow. I'm working on all the backlogged issues, and the high amount of activity has put this on the top of the list.
Is this still an issue on [email protected]+ now that we've landed https://github.com/FormidableLabs/nuka-carousel/pull/291?
@vijoditz-agustin , thankyou for the solution , it did the part but i am having issue on 1 slide/component as it has dropdown in it. Solution?
@tgg-praveengupta Can you provide an example of the component as you're using it with a dropdown? I haven't been able to reproduce this.
Because we haven't received any new information about this issue and the original behavior is no longer a problem in the current release, I'm closing this ticket. @tgg-praveengupta if you'd like to open a new issue with the behavior you're seeing with the dropdown, feel free to do that and we can look into it!