rcbyr / keen-slider

The HTML touch slider carousel with the most native feeling you will get.
https://keen-slider.io/
MIT License
4.67k stars 214 forks source link

fix: range should accept 0 as valid value #337

Closed kmorales13 closed 1 year ago

kmorales13 commented 1 year ago

In the function setRange, range values of 0 will be treated as falsy. These should be valid, for example, if we want to show only the first slide.

Input:

slides: [1,2,3],
...
range: {
  min: 0,
  max: 0,
}

Output:

minIdx: 0,
maxIdx: 2,

Expected:

minIdx: 0,
maxIdx: 0,