nuka-carousel icon indicating copy to clipboard operation
nuka-carousel copied to clipboard

Slide Height

Open nmkim8 opened this issue 11 years ago • 19 comments

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.

nmkim8 avatar Jul 31 '15 21:07 nmkim8

+1

ZetIsDeadBaby avatar Oct 30 '15 18:10 ZetIsDeadBaby

+1

truca avatar Nov 16 '15 19:11 truca

+1

Here21 avatar Dec 09 '15 11:12 Here21

+1

milesbeyond avatar Jan 21 '16 17:01 milesbeyond

How would you want this to work, exactly?

kenwheeler avatar Jan 21 '16 17:01 kenwheeler

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}>?

milesbeyond avatar Jan 21 '16 22:01 milesbeyond

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

ZetIsDeadBaby avatar Mar 23 '16 15:03 ZetIsDeadBaby

+1

benjaminmiles avatar Apr 20 '16 13:04 benjaminmiles

+1. It should work like wrote @Zetberg

xdroidx avatar Apr 26 '16 14:04 xdroidx

+1

nileshbhosale avatar Jun 23 '16 14:06 nileshbhosale

+1

prrraveen avatar Jul 12 '16 13:07 prrraveen

+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}>
 ...
}

vijoditz-agustin avatar Jul 31 '16 20:07 vijoditz-agustin

no news here? @kenwheeler

upq avatar Nov 20 '16 11:11 upq

@mdaxtman

kenwheeler avatar Nov 21 '16 18:11 kenwheeler

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.

mdaxtman avatar Nov 22 '16 08:11 mdaxtman

Is this still an issue on [email protected]+ now that we've landed https://github.com/FormidableLabs/nuka-carousel/pull/291?

ryan-roemer avatar Mar 10 '18 21:03 ryan-roemer

@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 avatar Apr 05 '18 04:04 tgg-praveengupta

@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.

sarmeyer avatar Sep 04 '18 16:09 sarmeyer

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!

sarmeyer avatar Sep 07 '18 16:09 sarmeyer