Skip to content

Commit 93ef0f8

Browse files
committed
Merge branch 'fix/carousel-consistent-interaction-stop' of github.com:J-Michalek/ui into fix/carousel-consistent-interaction-stop
2 parents bb7df30 + af6073c commit 93ef0f8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/runtime/components/Carousel.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,17 @@ watch(options, () => {
225225
226226
function scrollPrev() {
227227
emblaApi.value?.scrollPrev()
228+
229+
if (props.autoplay && (typeof props.autoplay === 'boolean' || props.autoplay.stopOnInteraction !== false)) {
230+
emblaApi.value?.plugins().autoplay?.stop()
231+
}
228232
}
229233
function scrollNext() {
230234
emblaApi.value?.scrollNext()
235+
236+
if (props.autoplay && (typeof props.autoplay === 'boolean' || props.autoplay.stopOnInteraction !== false)) {
237+
emblaApi.value?.plugins().autoplay?.stop()
238+
}
231239
}
232240
function scrollTo(index: number) {
233241
emblaApi.value?.scrollTo(index)

0 commit comments

Comments
 (0)