From bbf33ccbab16ffdbdfe4208093184003298de6d3 Mon Sep 17 00:00:00 2001 From: Yassine Haouzane Date: Tue, 21 Feb 2023 15:47:32 +0100 Subject: [PATCH] fix(helpers): condition to check if we reached the end of the carousel --- src/ItemsCarousel/helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ItemsCarousel/helpers.js b/src/ItemsCarousel/helpers.js index 172ada3..8b872af 100644 --- a/src/ItemsCarousel/helpers.js +++ b/src/ItemsCarousel/helpers.js @@ -118,7 +118,7 @@ export const calculateActiveItemTranslateX = ({ } // Last items to show - if(!infiniteLoop && gotoIndex > (numberOfChildren - numberOfCards - 1)) { + if(!infiniteLoop && gotoIndex > (numberOfChildren - numberOfCards)) { return calculateLastPossibleTranslateX({ activeItemIndex: gotoIndex, activePosition,