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/" diff --git a/src/index.tsx b/src/index.tsx index 4cb2c11..b927f52 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; @@ -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={() => {