From fdf2f866e948d030e7b29009ed5c06e384d74fe1 Mon Sep 17 00:00:00 2001
From: mehekj <mehek.jethani@gmail.com>
Date: Wed, 1 Mar 2023 21:17:28 -0500
Subject: drag and drop working

---
 .../views/collections/collectionSchema/SchemaRowBox.tsx  | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

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

diff --git a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
index 5de9fdf5c..4b709f670 100644
--- a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
@@ -40,15 +40,7 @@ export class SchemaRowBox extends ViewBoxBaseComponent<FieldViewProps>() {
 
     @action
     onRowPointerDown = (e: React.PointerEvent) => {
-        e.stopPropagation();
-
-        // setupMoveUpEvents(
-        //     this,
-        //     e,
-        //     e => this.schemaView?.startDrag(e, this.rootDoc, this.rowIndex) ?? true,
-        //     emptyFunction,
-        //     e => this.schemaView?.selectRow(e, this.rootDoc, this.rowIndex)
-        // );
+        setupMoveUpEvents(this, e, e => this.schemaView?.startDrag(e, this.rootDoc, this.rowIndex) ?? true, emptyFunction, emptyFunction, false);
     };
 
     onPointerEnter = (e: any) => {
@@ -97,9 +89,9 @@ export class SchemaRowBox extends ViewBoxBaseComponent<FieldViewProps>() {
                         ? { height: CollectionSchemaView._rowHeight, backgroundColor: Colors.LIGHT_BLUE, pointerEvents: this.schemaView?.props.isContentActive() ? 'all' : undefined /*, opacity: this.props.dragging ? 0.5 : 1 */ }
                         : { height: CollectionSchemaView._rowHeight, pointerEvents: this.schemaView?.props.isContentActive() ? 'all' : undefined }
                 }
-                // onPointerDown={this.onRowPointerDown}
-                // onPointerEnter={this.onPointerEnter}
-                // onPointerLeave={this.onPointerLeave}
+                onPointerDown={this.onRowPointerDown}
+                onPointerEnter={this.onPointerEnter}
+                onPointerLeave={this.onPointerLeave}
                 ref={(row: HTMLDivElement | null) => {
                     row && this.schemaView?.addRowRef(this.rootDoc, row);
                     this._ref = row;
-- 
cgit v1.2.3-70-g09d2

