diff options
author | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-05-02 00:57:20 -0400 |
---|---|---|
committer | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-05-02 00:57:20 -0400 |
commit | 847a65ba1f21d7751ff4839048cffb32dd952bb1 (patch) | |
tree | 8c67c3b7ebf0f61b9427284332bb36b57796b597 /src | |
parent | 154029278c92327eb48955ac2c7137b5a59b1d7d (diff) |
arrow selection fixed
Diffstat (limited to 'src')
-rw-r--r-- | src/client/util/SelectionManager.ts | 1 | ||||
-rw-r--r-- | src/client/views/collections/collectionSchema/CollectionSchemaView.tsx | 7 | ||||
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 2 |
3 files changed, 3 insertions, 7 deletions
diff --git a/src/client/util/SelectionManager.ts b/src/client/util/SelectionManager.ts index 1a8680e2b..b6ee4d5c3 100644 --- a/src/client/util/SelectionManager.ts +++ b/src/client/util/SelectionManager.ts @@ -44,7 +44,6 @@ export class SelectionManager { }); public static DeselectView = action((docView?: DocumentView): void => { - console.log("single deselect") if (docView && this.Instance.SelectedViews.includes(docView)) { docView.IsSelected = false; this.Instance.SelectedViews.splice(this.Instance.SelectedViews.indexOf(docView), 1); diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx index 7067aed5a..13370ea6b 100644 --- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx +++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx @@ -215,7 +215,6 @@ export class CollectionSchemaView extends CollectionSubView() { if (this._selectedDocs.includes(newDoc)) { SelectionManager.DeselectView(DocumentManager.Instance.getFirstDocumentView(curDoc)); this.deselectCell(curDoc); - } else { const shift: boolean = e.shiftKey; const ctrl: boolean = e.ctrlKey; @@ -229,12 +228,11 @@ export class CollectionSchemaView extends CollectionSubView() { break; case 'ArrowUp': { - const firstDoc = this.sortedDocs.docs[0]; + const firstDoc = this._selectedDocs.lastElement(); const firstIndex = this.rowIndex(firstDoc); const curDoc = this.sortedDocs.docs[firstIndex]; if (firstIndex > 0 && firstIndex < this.childDocs.length) { - console.log("firstindex: " + firstIndex + " docs: " + this.childDocs.length) - const newDoc = firstIndex < this.childDocs.length - 1 ? this.sortedDocs.docs[firstIndex - 1] : curDoc; + const newDoc = this.sortedDocs.docs[firstIndex - 1]; if (this._selectedDocs.includes(newDoc)){ SelectionManager.DeselectView(DocumentManager.Instance.getFirstDocumentView(curDoc)) this.deselectCell(curDoc); @@ -373,7 +371,6 @@ export class CollectionSchemaView extends CollectionSubView() { @undoBatch moveColumn = (fromIndex: number, toIndex: number) => { - console.log("from: " + fromIndex + " to: " + toIndex) if (toIndex === this._selectedCol) this._selectedCol = fromIndex; //keeps selected cell consistent let currKeys = this.columnKeys.slice(); diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 5f243ad9f..10a55b260 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -382,7 +382,7 @@ export class DocumentViewInternal extends DocComponent<FieldViewProps & Document onPointerDown = (e: React.PointerEvent): void => { if (this._props.isGroupActive?.() === 'child' && !this._props.isDocumentActive?.()) return; - this._longPressSelector = setTimeout(() => {console.log("long press"); DocumentView.LongPress && this._props.select(false), 1000}); //!!! + this._longPressSelector = setTimeout(() => (DocumentView.LongPress && this._props.select(false), 1000)); //!!! if (!GestureOverlay.DownDocView) GestureOverlay.DownDocView = this._docView; this._downX = e.clientX; |