Show floating action buttons on mobile after touchstart
parent
4e1a4a9d4e
commit
e0dd93ea12
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue