Vertical Mode slick-track height is too high
See original GitHub issueIn the Vertical mode example taken from the repository, the rendered slick-track has a height (2148 px) far in excess of the size of its contents. In my test, the slick-list parent had its height set to 546px - from visual observation at this height the slick-list is just tall enough to contain all 3 sliders.
Why is the nested slick-track div set to a much higher value?
Here is the HTML
<div class="slick-slider slick-vertical slick-initialized" dir="ltr">
<button type="button" data-role="none" class="slick-arrow slick-prev" style="display: block;"> Previous</button>
<div class="slick-list" style="height: 546px;">
<div class="slick-track" style="opacity: 1; transform: translate3d(0px, -546px, 0px); height: 2184px; transition: -webkit-transform 500ms ease 0s;">
<div data-index="-3" tabindex="-1" class="slick-slide slick-cloned" aria-hidden="true" style="width: 1461px;">
To reproduce, clone the repo, install and run it, then inspect the style height settings of the slick-track and slick-list div elements in the Vertical mode example
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:11
Top Results From Across the Web
Change height of Slick Carousel - css - Stack Overflow
I was having to set the height eg .slick-carousel{width: 200px;} because adaptive height ...
Read more >Contain or resize Vertical Slick Slider Images?
The vertical images in my slider are assigning too much screen real estate, essentially causing the height of the slideshow to be too...
Read more >Vertical Slick Slider - CodePen
Issue with slides losing active state when transitioning from last item to first item...
Read more >slick slider max height Code Example
slick -track { display: flex !important; } .slick-slide { height: auto; } ... slick slider using very height container · slick slider vertical...
Read more >Slick vertical wrong height 2 - JSFiddle - Code Playground
</div>. JavaScript + No-Library (pure JS) Tidy. xxxxxxxxxx. 8. 1. $('.slider').slick({. 2. vertical: true,. 3. verticalSwiping: true,. 4. infinite:false.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I figured out what was causing the problem for me. Although your problem may be different, I’m putting this here in hopes that it may help somebody else. On a vertical slider, if the number of “slidesToShow” is greater than the actual number of slides present, then the vertical slider breaks. For example, if I have “slidesToShow” set to 4 but there are only 3 images/slides, then I get the issue. So my workaround was to do a manual check of the length of the array feeding the data to my slideshow and only trigger the vertical slider if there were enough slides. Hope this helps somebody.
In vertical mode the height of the slides is not measured correctly. Basically this library only measures the first slide and uses that height for all the other slides. I’ve just created a fix for this check this fork out (the last 3 commits): https://github.com/ddobby94/react-slick