Skip to content

Commit

Permalink
Revert "fix: only add drag event listeners when dragging is enabled"
Browse files Browse the repository at this point in the history
This reverts commit 923fe44.
  • Loading branch information
piotr-s-brainhub committed Mar 30, 2020
1 parent d0d878d commit b8f8156
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/components/Carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,6 @@ class Carousel extends Component {
onTouchStart={this.onTouchStart}
clickable={this.getProp('clickToChange')}
isDragging={Math.abs(this.state.dragOffset) > this.props.minDraggableOffset}
isDraggingEnabled={this.props.draggable}
>
{carouselItem}
</CarouselItem>
Expand Down
5 changes: 2 additions & 3 deletions src/components/CarouselItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class CarouselItem extends PureComponent {
index: PropTypes.number,
currentSlideIndex: PropTypes.number,
isDragging: PropTypes.bool,
isDraggingEnabled: PropTypes.bool,
};

onMouseDown = event => {
Expand Down Expand Up @@ -43,8 +42,8 @@ class CarouselItem extends PureComponent {
minWidth: `${this.props.width}px`,
pointerEvents: this.props.isDragging ? 'none' : null,
}}
onMouseDown={this.props.isDraggingEnabled && this.onMouseDown}
onTouchStart={this.props.isDraggingEnabled && this.onTouchStart}
onMouseDown={this.onMouseDown}
onTouchStart={this.onTouchStart}
>
{this.props.children}
</li>
Expand Down

0 comments on commit b8f8156

Please sign in to comment.