YIZHUANG / react-multi-carousel

A lightweight production-ready Carousel that rocks supports multiple items and server-side rendering with no dependency. Bundle size 2kb.
MIT License
1.25k stars 286 forks source link

Application crashing with showDots when array lenght is changed and is now smaller. #318

Open walteraandrade opened 2 years ago

walteraandrade commented 2 years ago

Prerequisite

Describe the bug When the number of itens is smaller than the number shown in responsivess and it has showDots={true}, the carousel breaks the app with the message: RangeError Invalid array length

To Reproduce Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/cranky-fast-c9ptp?file=/src/App.js
  2. Click on 'Filter for Melissa'
  3. See error

Expected behavior The Carousel should adapt the the new state.

image