aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/EquationBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-03-06 19:46:43 -0500
committerbobzel <zzzman@gmail.com>2025-03-06 19:46:43 -0500
commit1ab6f6c87b746e0c2898694216db50d5faadf7f5 (patch)
tree84349c4bcbdfa0a53c4937421867e7665e7da663 /src/client/views/nodes/EquationBox.tsx
parent5ad858090f3006631062877d90120e3cc505fada (diff)
a bunch of changes to improve how docs are selected automatically when created.
Diffstat (limited to 'src/client/views/nodes/EquationBox.tsx')
-rw-r--r--src/client/views/nodes/EquationBox.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/views/nodes/EquationBox.tsx b/src/client/views/nodes/EquationBox.tsx
index 576b5bbe0..dcc6e27ed 100644
--- a/src/client/views/nodes/EquationBox.tsx
+++ b/src/client/views/nodes/EquationBox.tsx
@@ -30,12 +30,12 @@ export class EquationBox extends ViewBoxBaseComponent<FieldViewProps>() {
componentDidMount() {
this._props.setContentViewBox?.(this);
- if (Doc.SelectOnLoad === this.Document && (!DocumentView.LightboxDoc() || DocumentView.LightboxContains(this.DocumentView?.()))) {
+ if (DocumentView.SelectOnLoad === this.Document && (!DocumentView.LightboxDoc() || DocumentView.LightboxContains(this.DocumentView?.()))) {
this._props.select(false);
- this._ref.current!.mathField.focus();
- this.dataDoc.text === 'x' && this._ref.current!.mathField.select();
- Doc.SetSelectOnLoad(undefined);
+ this._ref.current?.mathField.focus();
+ this.dataDoc.text === 'x' && this._ref.current?.mathField.select();
+ DocumentView.SetSelectOnLoad(undefined);
}
reaction(
() => this._props.isSelected(),
@@ -66,7 +66,7 @@ export class EquationBox extends ViewBoxBaseComponent<FieldViewProps>() {
color: StrCast(this.Document.color),
fontSize: this.fontSize,
});
- Doc.SetSelectOnLoad(nextEq);
+ DocumentView.SetSelectOnLoad(nextEq);
this._props.addDocument?.(nextEq);
e.stopPropagation();
}