From 7ff3cd1fe471b10588eb582973b557b27255504b Mon Sep 17 00:00:00 2001 From: vpsmolina Date: Tue, 31 Oct 2023 17:05:40 +0300 Subject: [PATCH] fix(Carousel): added check for onActiveChange --- packages/core/src/other/components/Carousel/Carousel.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/core/src/other/components/Carousel/Carousel.tsx b/packages/core/src/other/components/Carousel/Carousel.tsx index 5e9b36183..f8c3f0f93 100644 --- a/packages/core/src/other/components/Carousel/Carousel.tsx +++ b/packages/core/src/other/components/Carousel/Carousel.tsx @@ -131,6 +131,7 @@ const Carousel = ({ setCurrIndex(index); } typeof onActiveChange === 'function' && + viewableItems[0]?.item && onActiveChange(viewableItems[0]?.item); } else { const length = viewableItems.length; @@ -150,6 +151,7 @@ const Carousel = ({ } typeof onActiveChange === 'function' && + viewableItems[middleVisibleElement]?.item && onActiveChange(viewableItems[middleVisibleElement]?.item); } },