From 47387ffe3367cea2f58501071bf8e1db11e42060 Mon Sep 17 00:00:00 2001 From: Florrie <towerofnix@gmail.com> Date: Tue, 18 Dec 2018 00:02:04 -0400 Subject: [PATCH] Fix "TouchEvent is not defined" error --- src/containers/stage.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/stage.jsx b/src/containers/stage.jsx index c5c36c2e6..ad0a9cbf0 100644 --- a/src/containers/stage.jsx +++ b/src/containers/stage.jsx @@ -236,7 +236,7 @@ class Stage extends React.Component { this.updateRect(); const {x, y} = getEventXY(e); 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({ mouseDown: true, mouseDownPosition: mousePosition, -- GitLab