react-slick icon indicating copy to clipboard operation
react-slick copied to clipboard

slickNext/slickPrev not working as expected

Open gtb104 opened this issue 2 years ago • 2 comments

The slickPrev() and slickNext() functions do not behave as expected if initialSlide is set to something other than 0, and infinite is false. This behavior is only seen the first time the 👈 or 👉 button is pressed (i.e. after a page refresh).

With an initialSlide of 2, the buttons behave as follows:

  • Previous - Goes to slide 0
  • Next - Goes to slide 1

Note: goTo() still works as expected

CodeSandbox example

gtb104 avatar Jul 06 '22 15:07 gtb104

This seems to be an issue which is already described in #1946. Additionaly there is an open PR for this which is currently open: https://github.com/akiran/react-slick/pull/2029

MauriceAyasse avatar Jul 14 '22 19:07 MauriceAyasse

I think you can use beforeChange

jason-liu22 avatar Aug 19 '22 08:08 jason-liu22