From 599252a946d43a63c0f979566209b94937b7cdcc Mon Sep 17 00:00:00 2001 From: Piotr Siatka Date: Fri, 10 Jul 2020 13:56:07 +0200 Subject: [PATCH] #609 Fix invalid invocation of Carousel handlers. --- src/controls/carousel/Carousel.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controls/carousel/Carousel.tsx b/src/controls/carousel/Carousel.tsx index b0a4df934..5c080c593 100644 --- a/src/controls/carousel/Carousel.tsx +++ b/src/controls/carousel/Carousel.tsx @@ -339,10 +339,10 @@ export class Carousel extends React.Component { } else { nextIndex = this.getNextIndex(nextButtonClicked); if (nextIndex !== currentIndex) { - if (nextButtonClicked) { + if (nextButtonClicked && this.props.onMoveNextClicked) { this.props.onMoveNextClicked(nextIndex); } - else { + else if(this.props.onMovePrevClicked) { this.props.onMovePrevClicked(nextIndex); } }