Skip to content

Commit

Permalink
fix(carousel): prevent intervals from being 0
Browse files Browse the repository at this point in the history
Prevents individual intervals from being `0`, preventing end-users to specify instant auto-play transitions from occurring per-interval

Co-authored-by: Jimmy Jia <tesrin@gmail.com>
  • Loading branch information
bpas247 and taion committed Aug 7, 2020
1 parent c1c72e0 commit 1d4294b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Carousel.tsx
Expand Up @@ -505,7 +505,7 @@ function CarouselFunc(uncontrolledProps: CarouselProps, ref) {

intervalHandleRef.current = window.setInterval(
document.visibilityState ? nextWhenVisible : next,
activeChildIntervalRef.current || interval || undefined,
activeChildIntervalRef.current ?? interval ?? undefined,
);

return () => {
Expand Down

0 comments on commit 1d4294b

Please sign in to comment.