joe223 / tiny-swiper

Ingenious JavaScript Carousel powered by wonderful plugins. Lightweight yet extensible. Import plugins as needed, No more, no less.
https://tiny-swiper.js.org
1.29k stars 58 forks source link

Should slide with shortcut while using loop mode #45

Closed AmelloAster closed 3 years ago

AmelloAster commented 3 years ago

What is expected?

when loop options is true, slide index = 0, click prev slide swiper should be 0-4.

What is actually happening?

now the slide swiper is 0-1-2-3-4, click next should same as.

joe223 commented 3 years ago

Check this out . I have add a new condition if (shortcut !== defaultWay && !excess)

https://github.com/joe223/tiny-swiper/commit/7dd7f19bb0824a0d92c055dccdd52fc6fca327dd#diff-45bc97c9e9ebdc8be6063771c13b38cf540c44a39251f51a18edf3a7a690bd31R201-R209