From c8d99b1efb6d0c3554a51668703cf202d581aef4 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Tue, 15 Oct 2019 11:25:59 +0300 Subject: [PATCH] Refactor #1030 --- src/components/carousel/Carousel.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/carousel/Carousel.js b/src/components/carousel/Carousel.js index 74cbe97532..c32e8317ed 100644 --- a/src/components/carousel/Carousel.js +++ b/src/components/carousel/Carousel.js @@ -432,7 +432,7 @@ export class Carousel extends Component { let stateChanged = false; let totalShiftedItems = this.state.totalShiftedItems; - if(this.props.autoplayInterval) { + if (this.props.autoplayInterval) { this.stopAutoplay(); } @@ -500,7 +500,7 @@ export class Carousel extends Component { } } - if(!stateChanged && this.isAutoplay()) { + if (!stateChanged && this.isAutoplay()) { this.startAutoplay(); } } @@ -509,6 +509,10 @@ export class Carousel extends Component { if (this.props.responsiveOptions) { this.unbindDocumentListeners(); } + + if (this.props.autoplayInterval) { + this.stopAutoplay(); + } } renderItems() {