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

Slider becomes empty and unnavigable when the number of slides is reduced

Open adamshone opened this issue 10 years ago • 0 comments

To repro:

  • set up a slider that displays 4 slides at a time, with 5 slides
  • navigate to the second page (1 slide will be in view)
  • re-render the slider with only 4 slides

Expected:

  • the user is moved back to the first page and can see the first 4 slides.
  • the dots and navigation buttons disappear or become disabled, because there is only one page now.

Actual:

  • the fifth slide disappears and the user has an empty slider.
  • the dots and navigation buttons disappear or become disabled, so you can't use the buttons to go back to the first page.
  • however you can get back to the first page by dragging with the mouse.

Here's a fiddle that demonstrates the problem: https://jsfiddle.net/89wqwvvx/3/

adamshone avatar Mar 23 '16 21:03 adamshone