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

Empty space at the end #540

Open
andricicezar opened this issue Nov 10, 2016 · 68 comments · May be fixed by #1538 or #2126
Open

Empty space at the end #540

andricicezar opened this issue Nov 10, 2016 · 68 comments · May be fixed by #1538 or #2126

Comments

@andricicezar
Copy link

How can I stop the carousel to let that empty space at the end?

I don't want infinite or center mode.

https://jsfiddle.net/20bumb4g/1576/

Thank you

@ghost
Copy link

ghost commented Dec 28, 2016

i also have the same issue of the extra space at the end

@VasilyShelkov
Copy link

@fahd what parent are you suggesting to set overflow:hidden on ? I'm finding that none of the parent containers work in hiding the empty space when overflow is set to hidden :S

@mthines
Copy link

mthines commented May 5, 2017

I've got the same problem.

When reaching the end of the list you can scroll further like shown in the gif below.

continuos scrolling in the end

Is there anyway to solve this problem with settings or would this be considered a bug? :)

Thanks!

@alexjfno1
Copy link

Has anyone managed to get anything working for this? Having the same issue.

@THPubs
Copy link

THPubs commented May 20, 2017

Ok I solved my issue! I added a custom style to the slick-slide class to remove a small line on the right.

Screenshot

Can you see the small light blue line on the right?
To fix it I did this:

.slick-slide{
  margin-right: 1px;
}

That rule caused the issue. So, in your case also there might be something which overflows the slider. I think if the inner content overflow, this happens.

@codermango
Copy link

Any update here?

@piersolenski
Copy link

+1

@aakashlpin
Copy link

Any update here? This is kind of a show stopper.

@harshitkumar31
Copy link

+1

5 similar comments
@calebo
Copy link

calebo commented Jul 26, 2017

+1

@vvasyliev
Copy link

+1

@dancnnm
Copy link

dancnnm commented Aug 21, 2017

+1

@Rusya13
Copy link

Rusya13 commented Sep 13, 2017

+1

@robertSahm
Copy link

+1

@CorwinCZ
Copy link

Bump & +1.

@vhmth
Copy link

vhmth commented Oct 19, 2017

@KODerFunk
Copy link

+1

5 similar comments
@inmutato
Copy link

inmutato commented Dec 4, 2017

+1

@djuta
Copy link

djuta commented Jan 2, 2018

+1

@markmanx
Copy link

markmanx commented Jan 3, 2018

+1

@rafaelderolez
Copy link

+1

@freott
Copy link

freott commented Jan 10, 2018

+1

@laveesingh
Copy link
Contributor

This has been resolved now. All you need now is to set infinite: false. Refer to the example: https:/akiran/react-slick/blob/master/examples/UnevenSetsFinite.js

@ro0t
Copy link

ro0t commented Jul 19, 2018

infinite: false did not solve my whitespace issue..

@dryleaf
Copy link

dryleaf commented Aug 10, 2018

@laveesingh @ro0t @mads-thines
Did you anyone find a solution to this problem?

I also described this issue in: #1334

@diegopamio
Copy link

I've made a fix (#1337) that would allow the finite variable width slider sliders to always fill the display area, using a new setting. I've added the pull request, not sure if it will be handled soon. In any case, you are free to use my own fork in your package.json:
"react-slick": "git+https://[email protected]/diegopamio/react-slick.git",

But ideally, if you can, also please vote so that the pull request gets attention.

@Razum
Copy link

Razum commented Aug 14, 2018

any progress on this issue?

@dryleaf
Copy link

dryleaf commented Aug 15, 2018

My ideal scroller would be the one that is:

  • finite
  • Variable width
  • scrolls all 100% visible slides at a time (irrespective of viewports or screen width)
  • with no paddings or centerings

@diegopamio
Copy link

Done. I've updated the PR with those requirements.

@groomain
Copy link

+1

1 similar comment
@SerhiiBychok
Copy link

+1

@twentyoneisawesome
Copy link

This is my solution.
in innerSliderUtils.js,
ln. 266 => targetSlide = Math.min(Math.max(0, spec.slideCount - spec.slidesToShow), currentSlide + slideOffset);
ln. 463 => newSlide = Math.min(Math.max(0, spec.slideCount - spec.slidesToShow), currentSlide + getSlideCount(spec));

@ivanesik
Copy link

+1

6 similar comments
@jyfernandez
Copy link

+1

@Viktor19931
Copy link

+1

@terrynguyen255
Copy link

+1

@D-Flime
Copy link

D-Flime commented Feb 4, 2020

+1

@georgewrmarshall
Copy link

+1

@terrynguyen255
Copy link

+1

@kratoskat
Copy link

Hi, this is also an issue when using swipeToSlide. It seems like the issue is inside innerSlideUtils.getTrackLeft

https://jsfiddle.net/fjLhxrqt/

@danihazler
Copy link

+1

@terreb
Copy link

terreb commented Aug 17, 2020

bump +1

@leimonio
Copy link

+1

@LirLi
Copy link

LirLi commented Sep 23, 2020

afterChange = () => {
const lastSlide = document.querySelector('.slick-slide:last-of-type');

const bounding = lastSlide.getBoundingClientRect();

if (bounding.x + 315 <= document.querySelector('.Slider__wrap').clientWidth) {
  document.querySelector('.slick-next').style.display = 'none';
} else {
  document.querySelector('.slick-next').style.display = 'block';
}

};

What element has class slick-next?

@amirhose1n
Copy link

finally worked , add this simple CSS code in to your project

.slick-next{
right:10px;
z-index: 1000;
}
.slick-prev{
left:10px;
z-index: 1000;
}

@parth1120
Copy link

Not able to find the exact solution, but if you keep slidesToShow as an even number you will not face this problem

@ko22009
Copy link

ko22009 commented Nov 19, 2021

+1

1 similar comment
@devGuerra
Copy link

+1

@Dey-Sumit
Copy link

if anyone still face this issue... i fixed this by setting the overflow as hidden to the Slider container
Yes, it solved the issue.

.slick-slider {
  overflow: hidden;
}

@yurimutti
Copy link

+1

1 similar comment
@araldicamila
Copy link

+1

@sayinmehmet47
Copy link

our timer show 28/01/2022 but still can not find solution:)

@ramirezcgn ramirezcgn linked a pull request Feb 2, 2022 that will close this issue
@mthines
Copy link

mthines commented Feb 14, 2022

The best solution for this is to switch to an alternative swiper library, like swiper.js.
Doesn't seem like the maintainers are actively trying to solve this.

@Dmitriyx
Copy link

Dmitriyx commented Feb 22, 2022

if anyone still face this issue... i fixed this by setting the overflow as hidden to the Slider container
Yes, it solved the issue.

.slick-slider {
  overflow: hidden;
}

this solved my problem

@GANESANGIDON
Copy link

if anyone still face this issue... i fixed this by setting the overflow as hidden to the Slider container
Yes, it solved the issue.

.slick-slider {
  overflow: hidden;
}

It worked for me thankyou.

@aman-maharshi
Copy link

In the slider settings object slidesToShow and slidesToShow keys should be changed according to the UI
in my case on desktop I'm showing 4 slides and on click of slider arrow I'm just moving 1 slide

let settings = {slidesToShow: 4, slidesToScroll: 1}

this worked for me, also these values can be changed depending on viewport width by adding the responsive key to the object

@FerCamposDev
Copy link

with tailwind

<Slider className="overflow-hidden">

works for me

@greatUzumaki
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet