Skip to content

Commit

Permalink
Fix dragging of crop on touch devices in React 17+ (regression)
Browse files Browse the repository at this point in the history
  • Loading branch information
sekoyo committed Jun 16, 2021
1 parent 19996db commit 10525e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/ReactCrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class ReactCrop extends PureComponent {
this.docMoveBound = false;
}

onCropMouseTouchDown = e => {
onCropPointerDown = e => {
const { crop, disabled } = this.props;
const { width, height } = this.mediaDimensions;
const pixelCrop = convertToPixelCrop(crop, width, height);
Expand Down Expand Up @@ -637,8 +637,7 @@ class ReactCrop extends PureComponent {
ref={this.bindCropSelectionRef}
style={style}
className="ReactCrop__crop-selection"
onMouseDown={this.onCropMouseTouchDown}
onTouchStart={this.onCropMouseTouchDown}
onPointerDown={this.onCropPointerDown}
>
{!disabled && !locked && (
<div className="ReactCrop__drag-elements">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-image-crop",
"version": "8.6.11",
"version": "8.6.12",
"description": "A responsive image cropping tool for React",
"repository": "https://github.com/DominicTobias/react-image-crop",
"main": "dist/ReactCrop.min.js",
Expand Down

0 comments on commit 10525e4

Please sign in to comment.