aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/formattedText/EquationView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-02-12 12:54:53 -0500
committerbobzel <zzzman@gmail.com>2025-02-12 12:54:53 -0500
commit5d738b4fe832ef1c554448440ede237c32632d10 (patch)
treee2e7a4eabe4472dca1bc4144f41491c36a0138cd /src/client/views/nodes/formattedText/EquationView.tsx
parent3e531aa898492cb05e25081f422bb59adab72e8e (diff)
cleaning up how text boxes maintain focus when UI widgets are interacted with.
Diffstat (limited to 'src/client/views/nodes/formattedText/EquationView.tsx')
-rw-r--r--src/client/views/nodes/formattedText/EquationView.tsx8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/client/views/nodes/formattedText/EquationView.tsx b/src/client/views/nodes/formattedText/EquationView.tsx
index df1421a33..e0450b202 100644
--- a/src/client/views/nodes/formattedText/EquationView.tsx
+++ b/src/client/views/nodes/formattedText/EquationView.tsx
@@ -110,13 +110,7 @@ export class EquationView {
}
selectNode() {
this.view.dispatch(this.view.state.tr.setSelection(new TextSelection(this.view.state.doc.resolve(this.getPos() ?? 0))));
- this.tbox._applyingChange = this.tbox.fieldKey; // setting focus will make prosemirror lose focus, which will cause it to change its selection to a text selection, which causes this view to get rebuilt but it's no longer node selected, so the equationview won't have focus
- setTimeout(() => {
- this._editor?.mathField.focus();
- setTimeout(() => {
- this.tbox._applyingChange = '';
- });
- });
+ setTimeout(() => this._editor?.mathField.focus());
}
deselectNode() {}
}