Skip to content

Commit 41af2b8

Browse files
authored
Fix 910 (#924)
* fix: #910 * 10.4.2
1 parent 42948d0 commit 41af2b8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-rnd",
3-
"version": "10.4.1",
3+
"version": "10.4.2",
44
"description": "",
55
"title": "react-rnd",
66
"main": "./lib/index.es5.js",

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ export class Rnd extends React.PureComponent<Props, State> {
363363
if (!this.props.onDrag) return;
364364
const { left, top } = this.offsetFromParent;
365365
if (!this.props.dragAxis || this.props.dragAxis === "both") {
366-
return this.props.onDrag(e, { ...data, x: data.x - left, y: data.y - top });
366+
return this.props.onDrag(e, { ...data, x: data.x + left, y: data.y + top });
367367
} else if (this.props.dragAxis === "x") {
368368
return this.props.onDrag(e, { ...data, x: data.x + left, y: this.originalPosition.y + top, deltaY: 0 });
369369
} else if (this.props.dragAxis === "y") {

0 commit comments

Comments
 (0)