Merge pull request #2032 from TriliumNext/math1

fix(math-edit): Set focus to input field when inserting math formula
This commit is contained in:
Elian Doran
2025-05-28 17:47:48 +03:00
committed by GitHub

View File

@@ -54,6 +54,10 @@ export default class MathUI extends Plugin {
this._addFormView();
this._balloon.showStack( 'main' );
requestAnimationFrame(() => {
this.formView?.mathInputView.fieldView.element?.focus();
});
}
private _createFormView() {
@@ -122,7 +126,6 @@ export default class MathUI extends Plugin {
formView.mathInputView.fieldView.once('render', () => {
const textarea = formView.mathInputView.fieldView.element;
if (!textarea) return;
textarea.focus();
Object.assign(textarea.style, {
resize: 'both',
height: '100px',