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

initialSlide and nextEl navigation #56

Open artnova-david opened 3 years ago

artnova-david commented 3 years ago

Describe the bug When passing an index to 'initialSlide' and the index is the last item in the array the 'nextEl' button is not automatically disabled, but it gets disabled after clicking on it.

Expected behavior When initializing Swiper with initialSlide as last index in the array automatically disable the 'nextEl' button.

Information

joe223 commented 3 years ago

Hi @artnova-david, problem occurred while after-slide event triggered.

Sliders will slide to initialSlide after DOM rendered on initialization process. Here is the code show below

https://github.com/joe223/tiny-swiper/blob/99f88d4bf690efab824234ccf326e2260665ed36/packages/tiny-swiper/src/core/index.ts#L123-L128

We should update Button state after slide action just like

https://github.com/joe223/tiny-swiper/blob/99f88d4bf690efab824234ccf326e2260665ed36/packages/tiny-swiper/src/modules/navigation.ts#L115-L120

Would you like to create a fix PR 😁 ?

a-kud commented 1 year ago

@joe223 is the help still required here?