Skip to content

Commit

Permalink
Fixed keyup event not added after it has been removed
Browse files Browse the repository at this point in the history
  • Loading branch information
YIZHUANG committed Aug 18, 2019
1 parent 0f6c31c commit ecd4f25
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Carousel.tsx
Expand Up @@ -242,6 +242,9 @@ class Carousel extends React.Component<CarouselProps, CarouselInternalState> {
any
>);
}
if (!keyBoardControl && this.props.keyBoardControl) {
window.addEventListener("keyup", this.onKeyUp as React.EventHandler<any>);
}
if (autoPlay && !this.props.autoPlay && this.autoPlay) {
clearInterval(this.autoPlay);
this.autoPlay = undefined;
Expand Down

0 comments on commit ecd4f25

Please sign in to comment.