From 53fd8244e086896124fb83b0b94edf3250407bf7 Mon Sep 17 00:00:00 2001 From: Vadym Shymko Date: Thu, 10 Nov 2022 17:22:24 +0200 Subject: [PATCH 1/3] Fix calculate next slide index when infite=false --- src/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 4cb2c11..c5d388e 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -435,7 +435,7 @@ function ReactSimplyCarousel({ const newSlideIndex = isOnEnd ? infinite ? nextSlideIndex - lastSlideIndex - 1 - : activeSlideIndex + : lastSlideIndex : nextSlideIndex; return newSlideIndex; @@ -448,7 +448,7 @@ function ReactSimplyCarousel({ const newSlideIndex = isOnStart ? infinite ? lastSlideIndex + 1 + nextSlideIndex - : activeSlideIndex + : 0 : nextSlideIndex; return newSlideIndex; From 3ae99f579b9d00776fb954d486f0ea7e98b39eab Mon Sep 17 00:00:00 2001 From: Vadym Shymko Date: Thu, 10 Nov 2022 22:35:26 +0200 Subject: [PATCH 2/3] Fix calculate active dot --- src/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index c5d388e..b927f52 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1029,8 +1029,9 @@ function ReactSimplyCarousel({ key={index} title={`${index}`} {...dotsNavBtnProps} - {...(Math.min(index * itemsToScroll, slidesItems.length - 1) === - activeSlideIndex + {...(activeSlideIndex >= index * itemsToScroll && + activeSlideIndex < + Math.min(itemsToScroll * (index + 1), lastSlideIndex + 1) ? dotsNavActiveBtnProps : {})} onClick={() => { From e3bc87cc12958852ac3b6e5632efe99964c083af Mon Sep 17 00:00:00 2001 From: Vadym Shymko Date: Thu, 10 Nov 2022 22:36:27 +0200 Subject: [PATCH 3/3] Update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ea1f3f3..f1519eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-simply-carousel", - "version": "8.4.0", + "version": "8.4.1", "description": "A simple, lightweight, fully controlled isomorphic (with SSR support) React.js carousel component. Touch enabled and responsive. With support for autoplay and infinity options. Fully customizable", "files": [ "dist/"