From 7e033818fb269b601c0fd489a96c771c9f5f0133 Mon Sep 17 00:00:00 2001 From: Jake Bartles <bartljak@gmail.com> Date: Fri, 29 Sep 2017 12:02:23 -0400 Subject: [PATCH] fixed issue #701 which was causing sprite to be dragged with a right click. --- src/containers/stage.jsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/containers/stage.jsx b/src/containers/stage.jsx index 6d3d58211..efe244153 100644 --- a/src/containers/stage.jsx +++ b/src/containers/stage.jsx @@ -179,14 +179,16 @@ class Stage extends React.Component { this.updateRect(); const {x, y} = getEventXY(e); const mousePosition = [x - this.rect.left, y - this.rect.top]; - this.setState({ - mouseDown: true, - mouseDownPosition: mousePosition, - mouseDownTimeoutId: setTimeout( - this.onStartDrag.bind(this, mousePosition[0], mousePosition[1]), - 500 - ) - }); + if (e.which === 1) { + this.setState({ + mouseDown: true, + mouseDownPosition: mousePosition, + mouseDownTimeoutId: setTimeout( + this.onStartDrag.bind(this, mousePosition[0], mousePosition[1]), + 500 + ) + }); + } const data = { isDown: true, x: mousePosition[0], -- GitLab