Skip to content

Commit

Permalink
[@mantine/carousel] Carousel: fixed carousel indicator not changing w…
Browse files Browse the repository at this point in the history
…hen slidesToScroll value is changed (#3058)
  • Loading branch information
Ryiski committed Nov 28, 2022
1 parent 23ccf51 commit c0379f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mantine-carousel/src/Carousel.tsx
Expand Up @@ -255,7 +255,7 @@ export const _Carousel = forwardRef<HTMLDivElement, CarouselProps>((props, ref)
}

return undefined;
}, [embla]);
}, [embla, slidesToScroll]);

useEffect(() => {
if (embla) {
Expand All @@ -265,7 +265,7 @@ export const _Carousel = forwardRef<HTMLDivElement, CarouselProps>((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;
Expand Down

0 comments on commit c0379f4

Please sign in to comment.