From bf4a2e489f3e80ec7037c01a3e413bd5de301f74 Mon Sep 17 00:00:00 2001 From: Torjus Date: Thu, 9 Aug 2018 10:17:08 +0200 Subject: [PATCH] Attempt fixing scrolling by preventing touchmove events --- app/lib/components/Room.jsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/lib/components/Room.jsx b/app/lib/components/Room.jsx index cf394ef..f388b88 100644 --- a/app/lib/components/Room.jsx +++ b/app/lib/components/Room.jsx @@ -49,16 +49,24 @@ class Room extends React.Component this.waitForHide(); } + handleTouchMove = (event) => + { + event.preventDefault(); + event.stopPropagation(); + }; + componentDidMount() { window.addEventListener('mousemove', this.handleMovement); window.addEventListener('touchstart', this.handleMovement); + document.body.addEventListener('touchmove', this.handleTouchMove, false); } componentWillUnmount() { window.removeEventListener('mousemove', this.handleMovement); window.removeEventListener('touchstart', this.handleMovement); + document.body.removeEventListener('touchmove', this.handleTouchMove); } render()