From 9114ec801c3c539c0c8103c5be2b1f27b0e5e0bf Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Thu, 4 Jun 2020 13:55:24 -0400 Subject: prevent scrolling when interacting with nested content in GridView --- .../views/collections/collectionGrid/CollectionGridView.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/collectionGrid/CollectionGridView.tsx b/src/client/views/collections/collectionGrid/CollectionGridView.tsx index dd4e28e33..1ce75dd28 100644 --- a/src/client/views/collections/collectionGrid/CollectionGridView.tsx +++ b/src/client/views/collections/collectionGrid/CollectionGridView.tsx @@ -171,7 +171,6 @@ export class CollectionGridView extends CollectionSubView(GridSchema) { onClick={this.onChildClickHandler} renderDepth={this.props.renderDepth + 1} parentActive={this.props.active} - display={"contents"} // this causes an issue- this is the reason the decorations box is weird with images and web boxes />; } @@ -289,7 +288,7 @@ export class CollectionGridView extends CollectionSubView(GridSchema) { style={{ // marginLeft: NumCast(this.props.Document._xMargin), marginRight: NumCast(this.props.Document._xMargin), // marginTop: NumCast(this.props.Document._yMargin), marginBottom: NumCast(this.props.Document._yMargin), - pointerEvents: !this.props.isSelected() && this.props.renderDepth !== 0 && !this.props.ContainingCollectionView?._isChildActive && !SnappingManager.GetIsDragging() ? "none" : undefined + pointerEvents: !this.props.active() && !SnappingManager.GetIsDragging() ? "none" : undefined }} ref={this.createDashEventsTarget} onPointerDown={e => { @@ -313,7 +312,10 @@ export class CollectionGridView extends CollectionSubView(GridSchema) { }
this._scroll = e.currentTarget.scrollTop)} + onScroll={action(e => { + if (!this.props.isSelected()) e.currentTarget.scrollTop = this._scroll; + else this._scroll = e.currentTarget.scrollTop; + })} onWheel={e => e.stopPropagation()} > e.currentTarget.focus()} /> -- cgit v1.2.3-70-g09d2