From 9fdc4810ef2fb3e5c2cd6ada0f465bfefb2544b3 Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Thu, 9 Jul 2020 11:52:05 -0400
Subject: fixed observing docking view golden layout window size changes.

---
 src/client/views/collections/CollectionDockingView.tsx | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

(limited to 'src/client/views/collections/CollectionDockingView.tsx')

diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index 79c577b6d..f408e24a8 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -390,6 +390,12 @@ export class CollectionDockingView extends React.Component<SubCollectionViewProp
     reactionDisposer?: Lambda;
     componentDidMount: () => void = () => {
         if (this._containerRef.current) {
+            const observer = new _global.ResizeObserver(action((entries: any) => {
+                for (const entry of entries) {
+                    this.onResize(null as any);
+                }
+            }));
+            observer.observe(this._containerRef.current);
             this.reactionDisposer = reaction(
                 () => this.props.Document.dockingConfig,
                 () => {
@@ -646,16 +652,8 @@ export class CollectionDockingView extends React.Component<SubCollectionViewProp
         if (this.props.renderDepth > 0) {
             return <div style={{ width: "100%", height: "100%" }}>Nested workspaces can't be rendered</div>;
         }
-        return (
-            <Measure offset onResize={this.onResize}>
-                {({ measureRef }) =>
-                    <div ref={measureRef}>
-                        <div className="collectiondockingview-container" id="menuContainer"
-                            onPointerDown={this.onPointerDown} onPointerUp={this.onPointerUp} ref={this._containerRef} />
-                    </div>
-                }
-            </Measure>
-        );
+        return <div className="collectiondockingview-container" id="menuContainer"
+            onPointerDown={this.onPointerDown} onPointerUp={this.onPointerUp} ref={this._containerRef} />;
     }
 
 }
-- 
cgit v1.2.3-70-g09d2

