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;