From dd8b15efe1e4d47a56797cd9f3541d6671e9c29c Mon Sep 17 00:00:00 2001 From: Forrest Li Date: Mon, 12 Feb 2018 17:07:03 -0500 Subject: [PATCH] fix(Layout): Activate views when clicked --- Sources/layouts/Layout2D.js | 4 ++++ Sources/layouts/Layout3D.js | 3 +++ 2 files changed, 7 insertions(+) diff --git a/Sources/layouts/Layout2D.js b/Sources/layouts/Layout2D.js index ff08efda..b59fc74f 100644 --- a/Sources/layouts/Layout2D.js +++ b/Sources/layouts/Layout2D.js @@ -56,6 +56,10 @@ export default class Layout2D extends React.Component { this.view.resetCamera(); setTimeout(this.view.resize, 500); + + // set mousedown capture on containers after view.setContainer. + this.container.addEventListener('mousedown', this.activateView, true); + this.sliderContainer.addEventListener('mousedown', this.activateView, true); } componentWillUnmount() { diff --git a/Sources/layouts/Layout3D.js b/Sources/layouts/Layout3D.js index 3a41c24b..a403e793 100644 --- a/Sources/layouts/Layout3D.js +++ b/Sources/layouts/Layout3D.js @@ -29,6 +29,9 @@ export default class Layout3D extends React.Component { this.view.resetCamera(); setTimeout(this.view.resize, 500); + + // set mousedown capture on container after view.setContainer. + this.container.addEventListener('mousedown', this.activateView, true); } componentWillUnmount() {