diff options
-rw-r--r-- | src/client/views/collections/collectionSchema/CollectionSchemaView.tsx | 4 | ||||
-rw-r--r-- | src/client/views/collections/collectionSchema/SchemaRowBox.tsx | 16 |
2 files changed, 6 insertions, 14 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx index 02591489b..c52a7f3e4 100644 --- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx +++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx @@ -343,14 +343,14 @@ export class CollectionSchemaView extends CollectionSubView() { @action selectRow = (doc: Doc, shift: boolean, ctrl: boolean) => { - console.log(ctrl); const index = this.childDocs.indexOf(doc); if (index < 0) return; if (shift && this._lastSelectedRow !== undefined) { const startRow = Math.min(this._lastSelectedRow, index); const endRow = Math.max(this._lastSelectedRow, index); for (let i = startRow; i <= endRow; i++) { - this.addDocToSelection(this.childDocs[i], true, i); + const currDoc = this.childDocs[i]; + if (!this._selectedDocs.has(currDoc)) this.addDocToSelection(currDoc, true, i); } this._lastSelectedRow = index; } else if (ctrl) { 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; |