aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionGrid/CollectionGridView.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-05-28 11:59:16 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-05-28 11:59:16 -0400
commit61b99fb1c667daeb06437d62c00d87a02c4f8479 (patch)
treed178dca621c853e4798b3a315b08c4bcc16d2f81 /src/client/views/collections/collectionGrid/CollectionGridView.tsx
parentf8945f5ec45e357ca5e0a483025f85425a8a1843 (diff)
should be working, but seems like there's a bug in grid packages interaction events.
Diffstat (limited to 'src/client/views/collections/collectionGrid/CollectionGridView.tsx')
-rw-r--r--src/client/views/collections/collectionGrid/CollectionGridView.tsx14
1 files changed, 12 insertions, 2 deletions
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}