Skip to content

Commit

Permalink
Merge pull request #62 from vadymshymko/61-back-button-navigation-issues
Browse files Browse the repository at this point in the history
61 back button navigation issues
  • Loading branch information
vadymshymko authored Nov 10, 2022
2 parents 89b875a + e3bc87c commit 70981c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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/"
Expand Down
9 changes: 5 additions & 4 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ function ReactSimplyCarousel({
const newSlideIndex = isOnEnd
? infinite
? nextSlideIndex - lastSlideIndex - 1
: activeSlideIndex
: lastSlideIndex
: nextSlideIndex;

return newSlideIndex;
Expand All @@ -448,7 +448,7 @@ function ReactSimplyCarousel({
const newSlideIndex = isOnStart
? infinite
? lastSlideIndex + 1 + nextSlideIndex
: activeSlideIndex
: 0
: nextSlideIndex;

return newSlideIndex;
Expand Down Expand Up @@ -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={() => {
Expand Down

0 comments on commit 70981c0

Please sign in to comment.