any other index above 0 does.
If the slider is already at 1st slide, slickGoTo(0) will not have any effect
the slider is on the 2nd slide.
I have 4 elements.
index is 0 to 3.
every slickGoto is working except 0, 0 supposed to get the slider to the beginning.
ok, I will check
Just looking at the code, I think it might be here:
https://github.com/akiran/react-slick/blob/master/src/inner-slider.jsx#L104
slickGoTo: function (slide) {
slide && this.changeSlide({
message: 'index',
index: slide,
currentSlide: this.state.currentSlide
});
},
If you go to slide 0, then this will evaluate to false since 0 is falsey in js. Maybe changing that first line to something like:
(slide || slide === 0) && this.changeSlide({
This issue is fixed in 0.13.4 version
Does slickGoTo remove the animation ? How to keep it ..
@manodupont You won't see animation If there is a state change just before calling slickGoTo becuase it causes re-render of react-slick.
You should avoid re-render of react-slick to see animation.
same issue
version 0.23.1
goes to each slide without problems except 0
Most helpful comment
the slider is on the 2nd slide.
I have 4 elements.
index is 0 to 3.
every slickGoto is working except 0, 0 supposed to get the slider to the beginning.