You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, as the title says, if you create a slider with the following options:
varsettings={infinite: false,initialSlide: 2// any value that is not 0 will still cause this problem};
The slider correctly displays the slide at index 2, but the first call to slickNext() (either through the arrows or via code) will show slide 1 and the first call to slickPrev() will show slide 0. It looks like internally the slider object still thinks it's displaying index 0 even though initialSlide is set to a different value. This is supported by the fact that calling slickGoTo(2) once after page render completely solves the issue (that is, subsequent calls to slickNext() and slickPrev() behave as they should).
Basically, as the title says, if you create a slider with the following options:
The slider correctly displays the slide at index 2, but the first call to
slickNext()
(either through the arrows or via code) will show slide 1 and the first call toslickPrev()
will show slide 0. It looks like internally the slider object still thinks it's displaying index 0 even thoughinitialSlide
is set to a different value. This is supported by the fact that callingslickGoTo(2)
once after page render completely solves the issue (that is, subsequent calls toslickNext()
andslickPrev()
behave as they should).CodeSandbox: https://codesandbox.io/s/initial-slide-issue-qjhzxd?file=/index.js
The text was updated successfully, but these errors were encountered: