aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-07-01 16:38:24 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-07-01 16:38:24 -0400
commit3dd0a92767972736f415341c0b6e06e6e3a242b1 (patch)
tree8bd0ae3b7ace187cd96e257a82d3b796d826552e /src/client/views/collections/collectionSchema/SchemaTableCell.tsx
parenta4199d30b81c464fd7ff15eee1fc56f432ee53a3 (diff)
highlighting then un-highlighting a selected cell with equations now properly maintains original select highlight
Diffstat (limited to 'src/client/views/collections/collectionSchema/SchemaTableCell.tsx')
-rw-r--r--src/client/views/collections/collectionSchema/SchemaTableCell.tsx10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
index 1f5684151..e2a05da7f 100644
--- a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
@@ -60,7 +60,7 @@ export interface SchemaTableCellProps {
autoFocus?: boolean; // whether to set focus on creation, othwerise wait for a click
rootSelected?: () => boolean;
rowSelected: () => boolean;
- isolatedSelection: [boolean, boolean];
+ isolatedSelection: (doc: Doc) => [boolean, boolean];
highlightCells: (text: string) => void;
equationHighlightRef: ObservableMap<HTMLDivElement, string>;
eqHighlightFunc: (text: string) => HTMLDivElement[] | [];
@@ -174,10 +174,6 @@ export class SchemaTableCell extends ObservableReactComponent<SchemaTableCellPro
const inQuotes = (field: string) => {return ((field.startsWith('`') && field.endsWith('`')) || (field.startsWith("'") && field.endsWith("'")) || (field.startsWith('"') && field.endsWith('"')))}
if (!inQuotes(this._submittedValue) && inQuotes(modField)) modField = modField.substring(1, modField.length - 1);
-
- const selfRefPattern = `d${this.docIndex}.${this._props.fieldKey}`
- const selfRefRegX = RegExp(selfRefPattern, 'g');
- if (selfRefRegX.exec(modField) !== null) { return 'Invalid'}
return eqSymbol + modField;
}
@@ -255,8 +251,8 @@ export class SchemaTableCell extends ObservableReactComponent<SchemaTableCellPro
const sides: Array<string | undefined> = [];
sides[0] = selectedCell(this._props) ? `solid 2px ${Colors.MEDIUM_BLUE}` : undefined; // left
sides[1] = selectedCell(this._props) ? `solid 2px ${Colors.MEDIUM_BLUE}` : undefined; // right
- sides[2] = (!this._props.isolatedSelection[0] && selectedCell(this._props)) ? `solid 2px ${Colors.MEDIUM_BLUE}` : undefined; // top
- sides[3] = (!this._props.isolatedSelection[1] && selectedCell(this._props)) ? `solid 2px ${Colors.MEDIUM_BLUE}` : undefined; // bottom
+ sides[2] = (!this._props.isolatedSelection(this._props.Document)[0] && selectedCell(this._props)) ? `solid 2px ${Colors.MEDIUM_BLUE}` : undefined; // top
+ sides[3] = (!this._props.isolatedSelection(this._props.Document)[1] && selectedCell(this._props)) ? `solid 2px ${Colors.MEDIUM_BLUE}` : undefined; // bottom
return sides;
}