mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
fix(math-edit): Set focus to input field when inserting math formula
This commit is contained in:
parent
111258b539
commit
3b09147e52
@ -54,6 +54,10 @@ export default class MathUI extends Plugin {
|
|||||||
this._addFormView();
|
this._addFormView();
|
||||||
|
|
||||||
this._balloon.showStack( 'main' );
|
this._balloon.showStack( 'main' );
|
||||||
|
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
this.formView?.mathInputView.fieldView.element?.focus();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private _createFormView() {
|
private _createFormView() {
|
||||||
@ -122,7 +126,6 @@ export default class MathUI extends Plugin {
|
|||||||
formView.mathInputView.fieldView.once('render', () => {
|
formView.mathInputView.fieldView.once('render', () => {
|
||||||
const textarea = formView.mathInputView.fieldView.element;
|
const textarea = formView.mathInputView.fieldView.element;
|
||||||
if (!textarea) return;
|
if (!textarea) return;
|
||||||
textarea.focus();
|
|
||||||
Object.assign(textarea.style, {
|
Object.assign(textarea.style, {
|
||||||
resize: 'both',
|
resize: 'both',
|
||||||
height: '100px',
|
height: '100px',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user