Skip to content

Build your personal knowledge base with Trilium Notes

Fix shift+tab behavior in MathInputView

meinzzzz87ab41c80c05
diff --git a/packages/ckeditor5-math/src/ui/mathinputview.ts b/packages/ckeditor5-math/src/ui/mathinputview.ts
index a3b93f3e17..027b7aab9b 100644
--- a/packages/ckeditor5-math/src/ui/mathinputview.ts
+++ b/packages/ckeditor5-math/src/ui/mathinputview.ts
@@ -203,10 +203,14 @@ export default class MathInputView extends View {
// Inline shortcut configuration is optional; ignore failures to avoid breaking the math field.
}
mf.addEventListener( 'keydown', ev => {
- if ( ev.key === 'Tab' && !ev.shiftKey ) {
- ev.preventDefault();
- ev.stopImmediatePropagation();
- this.latexTextAreaView.focus();
+ if ( ev.key === 'Tab' ) {
+ if ( ev.shiftKey ) {
+ ev.preventDefault();
+ } else {
+ ev.preventDefault();
+ ev.stopImmediatePropagation();
+ this.latexTextAreaView.focus();
+ }
}
}, { capture: true } );
mf.addEventListener( 'input', () => {