From e0dd93ea12c68bfa75b44ea8ca18893a66586feb Mon Sep 17 00:00:00 2001 From: Torjus Date: Wed, 25 Jul 2018 11:30:50 +0200 Subject: [PATCH] Show floating action buttons on mobile after touchstart --- app/lib/components/Room.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/lib/components/Room.jsx b/app/lib/components/Room.jsx index bcad5be..bfb12e9 100644 --- a/app/lib/components/Room.jsx +++ b/app/lib/components/Room.jsx @@ -34,7 +34,7 @@ class Room extends React.Component this.props.setToolbarsVisible(false); }, TIMEOUT); - handleMouseMove = () => + handleMovement = () => { // If the toolbars were hidden, show them again when // the user moves their cursor. @@ -48,12 +48,14 @@ class Room extends React.Component componentDidMount() { - window.addEventListener('mousemove', this.handleMouseMove); + window.addEventListener('mousemove', this.handleMovement); + window.addEventListener('touchstart', this.handleMovement); } componentWillUnmount() { - window.removeEventListener('mousemove', this.handleMouseMove); + window.removeEventListener('mousemove', this.handleMovement); + window.removeEventListener('touchstart', this.handleMovement); } render()