Skip to content
Snippets Groups Projects
Commit 47387ffe authored by Florrie's avatar Florrie
Browse files

Fix "TouchEvent is not defined" error

parent 80039a03
No related branches found
No related tags found
Loading
...@@ -236,7 +236,7 @@ class Stage extends React.Component { ...@@ -236,7 +236,7 @@ class Stage extends React.Component {
this.updateRect(); this.updateRect();
const {x, y} = getEventXY(e); const {x, y} = getEventXY(e);
const mousePosition = [x - this.rect.left, y - this.rect.top]; const mousePosition = [x - this.rect.left, y - this.rect.top];
if (e.button === 0 || e instanceof TouchEvent) { if (e.button === 0 || (window.TouchEvent && e instanceof TouchEvent)) {
this.setState({ this.setState({
mouseDown: true, mouseDown: true,
mouseDownPosition: mousePosition, mouseDownPosition: mousePosition,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment