diff --git a/package.json b/package.json index 50c82f8..6d05031 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-image-crop", - "version": "10.0.2", + "version": "10.0.3", "description": "A responsive image cropping tool for React", "repository": "https://github.com/DominicTobias/react-image-crop", "main": "dist/ReactCrop.min.js", diff --git a/src/ReactCrop.tsx b/src/ReactCrop.tsx index 9fdece6..9ade473 100644 --- a/src/ReactCrop.tsx +++ b/src/ReactCrop.tsx @@ -578,6 +578,13 @@ class ReactCrop extends PureComponent { } } + onDragFocus = (e: React.FocusEvent) => { + // Fixes #491 + if (this.componentRef.current?.scrollTop) { + this.componentRef.current.scrollTop = 0 + } + } + getCropStyle() { const { crop } = this.props @@ -738,7 +745,7 @@ class ReactCrop extends PureComponent { onKeyUp={this.onComponentKeyUp} > {!disabled && !locked && ( -
+