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

Vertical Mode slick-track height is too high #1425

Open
oaror opened this issue Nov 15, 2018 · 12 comments
Open

Vertical Mode slick-track height is too high #1425

oaror opened this issue Nov 15, 2018 · 12 comments

Comments

@oaror
Copy link

oaror commented Nov 15, 2018

In 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

@IMFIL
Copy link

IMFIL commented Dec 24, 2018

Still relevant

@ddobby94
Copy link

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

antonabyzov pushed a commit to antonabyzov/react-slick that referenced this issue Feb 5, 2020
@spasticninja
Copy link

I'm still seeing this issue. Has this made it to the release?

@bahamagician
Copy link

Just experienced this also. Still a problem.

@TechMky
Copy link

TechMky commented Jan 20, 2021

2021 and still experiencing this.
Has anyone found a fix that can be used until @ddobby94 changes are merged?

@vivekiyer114
Copy link

vivekiyer114 commented Feb 4, 2021

Still facing the same issue!
@ddobby94 Would be very grateful if you can please merge your code :)

@shumpaga
Copy link

shumpaga commented Feb 9, 2021

Facing the issue too

@bahamagician
Copy link

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.

@arkatriymfalnaya
Copy link

use adaptiveHeight: true setting

@dzikiite
Copy link

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.

That was exactly the problem, thank you very much!

@Tammura
Copy link

Tammura commented Dec 8, 2022

2022 and still facing the same issue!

@huykon
Copy link

huykon commented Jan 11, 2023

I also facing with the same issue until now

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