From c81889139aac5dd9aaedb3008ff1f09e5ec99044 Mon Sep 17 00:00:00 2001 From: adel-ak Date: Fri, 25 Nov 2022 14:04:46 +0300 Subject: [PATCH] [@mantine/carousel] Carousel: fixed carousel indicator not changing when slidesToScroll value is changed --- src/mantine-carousel/src/Carousel.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mantine-carousel/src/Carousel.tsx b/src/mantine-carousel/src/Carousel.tsx index c7713ea0d5d..8d97fb2f5ad 100644 --- a/src/mantine-carousel/src/Carousel.tsx +++ b/src/mantine-carousel/src/Carousel.tsx @@ -255,7 +255,7 @@ export const _Carousel = forwardRef((props, ref) } return undefined; - }, [embla]); + }, [embla, slidesToScroll]); useEffect(() => { if (embla) { @@ -265,7 +265,7 @@ export const _Carousel = forwardRef((props, ref) clamp(currentSelected, 0, Children.toArray(children).length - 1) ); } - }, [Children.toArray(children).length]); + }, [Children.toArray(children).length, slidesToScroll]); const canScrollPrev = embla?.canScrollPrev() || false; const canScrollNext = embla?.canScrollNext() || false;