aboutsummaryrefslogtreecommitdiff
path: root/src/mobile/MobileInterface.tsx
diff options
context:
space:
mode:
authorgeireann <60007097+geireann@users.noreply.github.com>2020-06-17 18:38:25 +0800
committergeireann <60007097+geireann@users.noreply.github.com>2020-06-17 18:38:25 +0800
commit0a60a9861c21efc95cb8f98b44b1ee02c5ebda02 (patch)
tree0ad8aea9475571653a7e629ae9ba36b9271a8c1e /src/mobile/MobileInterface.tsx
parent22649d15932f719e0b57166158a3660941a7ef72 (diff)
parent5b7b2a3e083d532758409474b8549b7bc16e7a4e (diff)
Merge branch 'mobile_revision_direct' of https://github.com/browngraphicslab/Dash-Web into mobile_revision_direct
Diffstat (limited to 'src/mobile/MobileInterface.tsx')
-rw-r--r--src/mobile/MobileInterface.tsx10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mobile/MobileInterface.tsx b/src/mobile/MobileInterface.tsx
index 7af11a9c4..68fb8b28f 100644
--- a/src/mobile/MobileInterface.tsx
+++ b/src/mobile/MobileInterface.tsx
@@ -79,6 +79,11 @@ export class MobileInterface extends React.Component {
document.addEventListener("dblclick", this.onReactDoubleClick);
}
+ @action
+ componentWillUnmount = () => {
+ document.removeEventListener('dblclick', this.onReactDoubleClick);
+ }
+
// Prevent zooming in when double tapping the screen
onReactDoubleClick = (e: MouseEvent) => {
e.stopPropagation();
@@ -316,8 +321,9 @@ export class MobileInterface extends React.Component {
this._child = null;
this.switchCurrentView((userDoc: Doc) => doc);
this._parents.length = index;
- } else if (doc === this._homeDoc) this.returnHome();
- else {
+ } else if (doc === this._homeDoc) {
+ this.returnHome();
+ } else {
this._activeDoc = doc;
this._child = doc;
this.switchCurrentView((userDoc: Doc) => doc);