aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/EquationBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-03-04 10:06:31 -0500
committerbobzel <zzzman@gmail.com>2021-03-04 10:06:31 -0500
commitfee3821a95072ae31dbe7d79ef9e032040ef7738 (patch)
tree51574b8416d5f9b861b76c1b7d64d560ba0029ab /src/client/views/nodes/EquationBox.tsx
parent524bb41d2d5a74dc00d26e7abc079574e10a52a7 (diff)
fixed dynamic updating of equations and functions when underlying data cahnges.
Diffstat (limited to 'src/client/views/nodes/EquationBox.tsx')
-rw-r--r--src/client/views/nodes/EquationBox.tsx7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/client/views/nodes/EquationBox.tsx b/src/client/views/nodes/EquationBox.tsx
index f49405d02..a8c5430a9 100644
--- a/src/client/views/nodes/EquationBox.tsx
+++ b/src/client/views/nodes/EquationBox.tsx
@@ -32,6 +32,12 @@ export class EquationBox extends ViewBoxBaseComponent<FieldViewProps, EquationDo
this._ref.current!.mathField.focus();
this._ref.current!.mathField.select();
}
+ reaction(() => StrCast(this.dataDoc.text),
+ text => {
+ if (text && text !== this._ref.current!.mathField.latex()) {
+ this._ref.current!.mathField.latex(text);
+ }
+ })
reaction(() => this.props.isSelected(),
selected => {
if (this._ref.current) {
@@ -78,6 +84,7 @@ export class EquationBox extends ViewBoxBaseComponent<FieldViewProps, EquationDo
}
render() {
TraceMobx();
+ console.log("eqn" + this.dataDoc.text)
return (<div onPointerDown={e => !e.ctrlKey && e.stopPropagation()}
style={{
pointerEvents: !this.props.isSelected() ? "none" : undefined,