mirror of
https://github.com/zadam/trilium.git
synced 2026-01-12 09:34:26 +01:00
Close Virtual Keyboard when Mathinput is closed
This commit is contained in:
parent
28dd85c1d1
commit
8a385972fc
@ -189,6 +189,9 @@ export default class MathUI extends Plugin {
|
||||
|
||||
private _removeFormView() {
|
||||
if ( this._isFormInPanel && this.formView ) {
|
||||
// Hide virtual keyboard before removing the form
|
||||
this.formView.hideKeyboard();
|
||||
|
||||
this.formView.saveButtonView.focus();
|
||||
this._balloon.remove( this.formView );
|
||||
|
||||
|
||||
@ -172,4 +172,8 @@ export default class MainFormView extends View {
|
||||
} );
|
||||
return btn;
|
||||
}
|
||||
|
||||
public hideKeyboard(): void {
|
||||
this.mathInputView.hideKeyboard();
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,13 +36,13 @@ export default class MathInputView extends View {
|
||||
tag: 'div',
|
||||
attributes: { class: ['ck-mathlive-container'] }
|
||||
},
|
||||
// LaTeX label (outside wrapper)
|
||||
// LaTeX label
|
||||
{
|
||||
tag: 'label',
|
||||
attributes: { class: ['ck-latex-label'] },
|
||||
children: [t('LaTeX')]
|
||||
},
|
||||
// Raw LaTeX wrapper (just textarea now)
|
||||
// Raw LaTeX wrapper
|
||||
{
|
||||
tag: 'div',
|
||||
attributes: { class: ['ck-latex-wrapper'] },
|
||||
@ -176,15 +176,15 @@ export default class MathInputView extends View {
|
||||
}
|
||||
|
||||
public hideKeyboard(): void {
|
||||
if (this.mathfield) {
|
||||
try {
|
||||
this.mathfield.blur();
|
||||
(this.mathfield as any).executeCommand?.('hideVirtualKeyboard');
|
||||
} catch { /* MathLive may already be disposed */ }
|
||||
if (typeof window !== 'undefined' && window.mathVirtualKeyboard?.visible) {
|
||||
window.mathVirtualKeyboard.hide();
|
||||
}
|
||||
}
|
||||
|
||||
public override destroy(): void {
|
||||
// Hide keyboard before destroying
|
||||
this.hideKeyboard();
|
||||
|
||||
if (this.mathfield) {
|
||||
try {
|
||||
this.mathfield.blur();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user