Skip to content

Commit 72b50c9

Browse files
committed
fix(carousel): when paused (interval=0) and manually changed slide, it does not restart when interval>0
1 parent 8542552 commit 72b50c9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

projects/coreui-angular/src/lib/carousel/carousel/carousel.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export class CarouselComponent implements OnInit, OnDestroy, AfterContentInit {
194194
#visible: boolean = true;
195195

196196
setTimer(): void {
197-
const interval = this.activeItemInterval || 0;
197+
const interval = this.activeItemInterval || this.interval();
198198
const direction = this.direction();
199199
this.resetTimer();
200200
if (interval > 0) {
@@ -217,6 +217,7 @@ export class CarouselComponent implements OnInit, OnDestroy, AfterContentInit {
217217
}
218218
this.activeItemInterval =
219219
typeof nextItem.interval === 'number' && nextItem.interval > -1 ? nextItem.interval : this.interval();
220+
console.log('activeItemInterval', nextItem.interval, this.activeItemInterval);
220221
const direction = this.direction();
221222
const isLastItem =
222223
(nextItem.active === nextItem.lastItemIndex && direction === 'next') ||

0 commit comments

Comments
 (0)