From 61b99fb1c667daeb06437d62c00d87a02c4f8479 Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Thu, 28 May 2020 11:59:16 -0400
Subject: should be working, but seems like there's a bug in grid packages
 interaction events.

---
 .../collections/collectionGrid/CollectionGridView.tsx      | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

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

diff --git a/src/client/views/collections/collectionGrid/CollectionGridView.tsx b/src/client/views/collections/collectionGrid/CollectionGridView.tsx
index 9b24f1961..c56a894dc 100644
--- a/src/client/views/collections/collectionGrid/CollectionGridView.tsx
+++ b/src/client/views/collections/collectionGrid/CollectionGridView.tsx
@@ -231,7 +231,7 @@ export class CollectionGridView extends CollectionSubView(GridSchema) {
         //     console.log(layout[0].w);
         // }
 
-
+        console.log(this.props.Document.title + " " + this.props.isSelected() + " " + (!this.props.isSelected() && this.props.renderDepth !== 0 && !this.props.ContainingCollectionView?._isChildActive && !SnappingManager.GetIsDragging() ? "none" : undefined));
         return (
             <div className="collectionGridView_contents"
                 style={{
@@ -240,12 +240,22 @@ export class CollectionGridView extends CollectionSubView(GridSchema) {
                     pointerEvents: !this.props.isSelected() && this.props.renderDepth !== 0 && !this.props.ContainingCollectionView?._isChildActive && !SnappingManager.GetIsDragging() ? "none" : undefined
                 }}
                 ref={this.createDashEventsTarget}
-                onPointerDown={e => { ((e.target as any)?.className.includes("react-resizable-handle")) && e.stopPropagation(); }} // the grid doesn't stopPropagation when its widgets are hit, so we need to otherwise the outer documents will respond
+                onPointerDown={e => {
+                    if (this.props.active(true)) {
+                        if (this.props.isSelected(true)) {
+                            e.stopPropagation();
+                        }
+                    }
+                    if (this.props.isSelected(true)) {
+                        !((e.target as any)?.className.includes("react-resizable-handle")) && e.preventDefault();
+                    }
+                }} // the grid doesn't stopPropagation when its widgets are hit, so we need to otherwise the outer documents will respond
             >
                 <Grid
                     width={this.props.PanelWidth()}
                     nodeList={contents}
                     layout={layout}
+                    childrenDraggable={this.props.isSelected() ? true : false}
                     transformScale={this.props.ScreenToLocalTransform().Scale}
                     numCols={this.props.Document.numCols as number}
                     rowHeight={this.props.Document.rowHeight as number}
-- 
cgit v1.2.3-70-g09d2

