Skip to content

The Open Source DocuSign Alternative.

fix: reset autoplay timer when you manually click on a new slide

Ephraim Atta-Duncanc86edbefb7a7
diff --git a/apps/marketing/src/components/(marketing)/carousel.tsx b/apps/marketing/src/components/(marketing)/carousel.tsx
index 252ad8d24..51ee3fed0 100644
--- a/apps/marketing/src/components/(marketing)/carousel.tsx
+++ b/apps/marketing/src/components/(marketing)/carousel.tsx
@@ -80,6 +80,13 @@ export const Carousel = () => {
emblaThumbsApi.scrollTo(emblaApi.selectedScrollSnap());
resetProgress();
+ const autoplay = emblaApi.plugins()?.autoplay;
+
+ console.log(autoplay);
+
+ if (autoplay) {
+ autoplay.reset();
+ }
}, [emblaApi, emblaThumbsApi, setSelectedIndex]);
const resetProgress = useCallback(() => {