Show floating action buttons on mobile after touchstart

master
Torjus 2018-07-25 11:30:50 +02:00
parent 4e1a4a9d4e
commit e0dd93ea12
1 changed files with 5 additions and 3 deletions

View File

@ -34,7 +34,7 @@ class Room extends React.Component
this.props.setToolbarsVisible(false); this.props.setToolbarsVisible(false);
}, TIMEOUT); }, TIMEOUT);
handleMouseMove = () => handleMovement = () =>
{ {
// If the toolbars were hidden, show them again when // If the toolbars were hidden, show them again when
// the user moves their cursor. // the user moves their cursor.
@ -48,12 +48,14 @@ class Room extends React.Component
componentDidMount() componentDidMount()
{ {
window.addEventListener('mousemove', this.handleMouseMove); window.addEventListener('mousemove', this.handleMovement);
window.addEventListener('touchstart', this.handleMovement);
} }
componentWillUnmount() componentWillUnmount()
{ {
window.removeEventListener('mousemove', this.handleMouseMove); window.removeEventListener('mousemove', this.handleMovement);
window.removeEventListener('touchstart', this.handleMovement);
} }
render() render()