Skip to content

Commit d376ec2

Browse files
author
Piotr Siatka
committed
Fix: wrong next button disabled condition.
Remove unused code.
1 parent 1e52321 commit d376ec2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/controls/carousel/Carousel.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ export class Carousel extends React.Component<ICarouselProps, ICarouselState> {
8383
element
8484
}
8585

86-
{
87-
!processing && !element && this.props.children && React.Children.count(this.props.children) > 0 &&
88-
this.props.children[currentIndex]
89-
}
9086
</div>
9187

9288
<div className={this.getMergedStyles(this.getButtonContainerStyles(), containerButtonsStyles)}
@@ -176,7 +172,7 @@ export class Carousel extends React.Component<ICarouselProps, ICarouselState> {
176172
if (nextButton) {
177173
result = this.props.canMoveNext != undefined ?
178174
!this.props.canMoveNext :
179-
(currentIndex === React.Children.count(this.props.children) - 1) && !isInfinite;
175+
(currentIndex === (this.props.element as JSX.Element[]).length - 1) && !isInfinite;
180176
} else {
181177
result = this.props.canMovePrev != undefined ?
182178
!this.props.canMovePrev :

0 commit comments

Comments
 (0)