aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-06-25 12:10:05 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-06-25 12:10:05 -0400
commit54559c677ac3a91e72680b5b7c889d63439edf58 (patch)
tree815e790c0ac836ff12dcd04532bb817da8f0d9ae /src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
parent3809bb004617a20fd631388d9cf404fa34c3ad52 (diff)
focus is no longer lost
Diffstat (limited to 'src/client/views/collections/collectionSchema/CollectionSchemaView.tsx')
-rw-r--r--src/client/views/collections/collectionSchema/CollectionSchemaView.tsx26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
index c3dc4bad6..3b5a32ca7 100644
--- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
+++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
@@ -634,6 +634,7 @@ export class CollectionSchemaView extends CollectionSubView() {
@action
clearSelection = () => {
+ if (this._referenceSelectMode.enabled) return;
DocumentView.DeselectAll();
this.deselectAllCells();
};
@@ -651,20 +652,19 @@ export class CollectionSchemaView extends CollectionSubView() {
}
};
- @action
- selectCell = (doc: Doc | undefined, col: number, shiftKey: boolean, ctrlKey: boolean) => {
+ selectReference = (doc: Doc | undefined, col: number) => {
if (!doc) return;
+ const docIndex = DocumentView.getDocViewIndex(doc);
+ const field = this.columnKeys[col];
+ const refToAdd = `d${docIndex}.${field}`
+ const editedField = this._referenceSelectMode.currEditing ? this._referenceSelectMode.currEditing as SchemaCellField : null;
+ editedField?.appendText(refToAdd);
+ editedField?.setupRefSelect(false);
+ return;
+ }
- if (this._referenceSelectMode.enabled) {
- const docIndex = DocumentView.getDocViewIndex(doc);
- const field = this.columnKeys[col];
- const refToAdd = `d${docIndex}.${field}`
- const editedField = this._referenceSelectMode.currEditing ? this._referenceSelectMode.currEditing as SchemaCellField : null;
- editedField?.appendText(refToAdd);
- editedField?.setupRefSelect(false);
- return;
- }
-
+ @action
+ selectCell = (doc: Doc, col: number, shiftKey: boolean, ctrlKey: boolean) => {
this.closeColumnMenu();
if (!shiftKey && !ctrlKey) this.clearSelection();
!this._selectedCells && (this._selectedCells = []);
@@ -687,12 +687,14 @@ export class CollectionSchemaView extends CollectionSubView() {
@action
deselectCell = (doc: Doc) => {
+ console.log('single deselect called')
this._selectedCells && (this._selectedCells = this._selectedCells.filter(d => d !== doc));
if (this.rowIndex(doc) === this._lowestSelectedIndex) this._lowestSelectedIndex = Math.min(...this._selectedDocs.map(d => this.rowIndex(d)));
};
@action
deselectAllCells = () => {
+ console.log('deselectall called')
this._selectedCells = [];
this._lowestSelectedIndex = -1;
};