aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema/SchemaCellField.tsx
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-06-21 12:37:47 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-06-21 12:37:47 -0400
commit24fad06cbd2e273bb6729f21956e35243e602bb7 (patch)
tree851f46c5e1d647a7559d5bd8af0c1de04524135c /src/client/views/collections/collectionSchema/SchemaCellField.tsx
parent8414744f15b58f55cee14dbabb5c0e6a4a62a4c6 (diff)
fixed bug where equation didn't save in cell field on reloading (batching issue)
Diffstat (limited to 'src/client/views/collections/collectionSchema/SchemaCellField.tsx')
-rw-r--r--src/client/views/collections/collectionSchema/SchemaCellField.tsx7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client/views/collections/collectionSchema/SchemaCellField.tsx b/src/client/views/collections/collectionSchema/SchemaCellField.tsx
index 6663fb68f..dcfa4f6f2 100644
--- a/src/client/views/collections/collectionSchema/SchemaCellField.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaCellField.tsx
@@ -39,8 +39,10 @@ export class SchemaCellField extends ObservableReactComponent<SchemaCellFieldPro
get docIndex(){return DocumentView.getDocViewIndex(this._props.Document);} // prettier-ignore
componentDidMount(): void {
- this._content = this.props.GetValue() ?? '';
- this.setContent(this._content);
+ setTimeout(() => {
+ this._content = this._props.GetValue() ?? '';
+ this.setContent(this._content);
+ }, 0); //must be moved to end of batch or else other docs aren't loaded, so render as d-1 in function
this._disposers.editing = reaction(
() => this._editing,
editing => {
@@ -50,6 +52,7 @@ export class SchemaCellField extends ObservableReactComponent<SchemaCellFieldPro
this._overlayDisposer?.();
this._overlayDisposer = OverlayView.Instance.addElement(<DocumentIconContainer />, { x: 0, y: 0 });
this._props.highlightCells?.(this._props.GetValue() ?? '');
+ if (this._props.Document.type === 'collection') console.log('highlight: ' + this._props.GetValue())
this.setContent(this._content);
}
});