aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/collections/collectionSchema/CollectionSchemaView.tsx46
-rw-r--r--src/client/views/collections/collectionSchema/SchemaRowBox.tsx2
2 files changed, 20 insertions, 28 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
index 0cf5a1ed9..a0e1ae8b2 100644
--- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
+++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
@@ -125,32 +125,26 @@ export class CollectionSchemaView extends CollectionSubView() {
@action
onKeyDown = (e: KeyboardEvent) => {
- // if (this._selectedDocs.size > 0) {
- // if (e.key == 'ArrowDown') {
- // const lastDoc = Array.from(this._selectedDocs.values()).lastElement();
- // const lastIndex = this.childDocs.indexOf(lastDoc);
- // if (lastIndex >= 0 && lastIndex < this.childDocs.length - 1) {
- // this._selectedDocs.clear();
- // const newDoc = this.childDocs[lastIndex + 1];
- // this._selectedDocs.add(newDoc);
- // const presDocView = DocumentManager.Instance.getDocumentView(this.rootDoc);
- // if (presDocView) SelectionManager.SelectView(presDocView, false);
- // SelectionManager.SelectSchemaViewDoc(newDoc);
- // this._previewDoc = newDoc;
- // }
- // }
- // if (e.key == 'ArrowUp') {
- // const firstDoc = Array.from(this._selectedDocs.values())[0];
- // const firstIndex = this.childDocs.indexOf(firstDoc);
- // if (firstIndex > 0) {
- // this._selectedDocs.clear();
- // const newDoc = this.childDocs[firstIndex - 1];
- // this._selectedDocs.add(newDoc);
- // SelectionManager.SelectSchemaViewDoc(newDoc);
- // this._previewDoc = newDoc;
- // }
- // }
- // }
+ if (this._selectedDocs.size > 0) {
+ if (e.key == 'ArrowDown') {
+ const lastDoc = Array.from(this._selectedDocs.values()).lastElement();
+ const lastIndex = this.rowIndex(lastDoc);
+ if (lastIndex >= 0 && lastIndex < this.childDocs.length - 1) {
+ !e.shiftKey && this.clearSelection();
+ const newDoc = this.childDocs[lastIndex + 1];
+ this.addDocToSelection(newDoc, e.shiftKey, lastIndex + 1);
+ }
+ }
+ if (e.key == 'ArrowUp') {
+ const firstDoc = Array.from(this._selectedDocs.values())[0];
+ const firstIndex = this.rowIndex(firstDoc);
+ if (firstIndex > 0 && firstIndex < this.childDocs.length) {
+ !e.shiftKey && this.clearSelection();
+ const newDoc = this.childDocs[firstIndex - 1];
+ this.addDocToSelection(newDoc, e.shiftKey, firstIndex - 1);
+ }
+ }
+ }
};
@undoBatch
diff --git a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
index 0e7b0fa16..0ed5f2df4 100644
--- a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
@@ -38,8 +38,6 @@ export class SchemaRowBox extends ViewBoxBaseComponent<FieldViewProps>() {
return this.schemaView?.rowIndex(this.rootDoc) ?? -1;
}
- // isSelected = () => this.props.selectedDocs.has(this.props.Document);
-
@action
onRowPointerDown = (e: React.PointerEvent) => {
e.stopPropagation();