From 61b99fb1c667daeb06437d62c00d87a02c4f8479 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik 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 ++++++++++++-- src/client/views/collections/collectionGrid/Grid.tsx | 6 ++---- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'src') 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 (
{ ((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 > { * @param layout `Layout[]` */ onLayoutChange(layout: Layout[]) { - console.log("setting in grid component" + layout[0].w); this.props.setLayout(layout); } - Scale = 2 render() { - console.log("In grid layout prop received value= " + this.props.layout?.[0]?.w); return ( { width={this.props.width} compactType={null} isDroppable={true} + isDraggable={this.props.childrenDraggable} useCSSTransforms={true} margin={[10, 10]} onLayoutChange={layout => this.onLayoutChange(layout)} -- cgit v1.2.3-70-g09d2