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-06-23 02:54:24 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-06-23 02:54:24 -0400
commit9fab1b3ac096138fba3a99a2515ec44b526a3956 (patch)
tree531dd1844d82d1f9e6fd60036596a160c19b76ae /src/client/views/collections/collectionSchema/SchemaTableCell.tsx
parent1775ceb9b840ab73194eb84e673ef692c1fef454 (diff)
text highlight works with 'this.' format
Diffstat (limited to 'src/client/views/collections/collectionSchema/SchemaTableCell.tsx')
-rw-r--r--src/client/views/collections/collectionSchema/SchemaTableCell.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
index ab384a487..6ccada48c 100644
--- a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
@@ -144,10 +144,10 @@ export class SchemaTableCell extends ObservableReactComponent<SchemaTableCellPro
return { color, textDecoration, fieldProps, cursor, pointerEvents };
}
- adjustedHighlight = (field: string) => {
+ adjustSelfReference = (field: string) => {
const pattern = /\bthis.\b/g;
const modField = field.replace(pattern, `d${this.docIndex}.`);
- this._props.highlightCells(modField);
+ return modField;
}
// parses a field from the "idToDoc(####)" format to DocumentId (d#) format for readability
@@ -183,8 +183,8 @@ export class SchemaTableCell extends ObservableReactComponent<SchemaTableCellPro
}}>
<SchemaCellField
Document={this._props.Document}
- highlightCells={this.adjustedHighlight}
- getCells={this._props.func}
+ highlightCells={(text: string) => this._props.highlightCells(this.adjustSelfReference(text))}
+ getCells={(text: string) => this._props.func(this.adjustSelfReference(text))}
ref={r => selectedCell(this._props) && this._props.autoFocus && r?.setIsFocused(true)}
oneLine={this._props.oneLine}
contents={undefined}