Skip to content

Build your personal knowledge base with Trilium Notes

Fix clicking issue in Mathfield

Meinzzzz29f0881c5a79
diff --git a/packages/ckeditor5-math/src/mathui.ts b/packages/ckeditor5-math/src/mathui.ts
index 8b41510e0a..030e34e4dc 100644
--- a/packages/ckeditor5-math/src/mathui.ts
+++ b/packages/ckeditor5-math/src/mathui.ts
@@ -71,7 +71,6 @@ export default class MathUI extends Plugin {
throw new CKEditorError( 'math-command' );
}
-
const mathConfig = editor.config.get( 'math' )!;
const formView = new MainFormView(
diff --git a/packages/ckeditor5-math/src/ui/mainformview.ts b/packages/ckeditor5-math/src/ui/mainformview.ts
index 2c327517ce..8e7d62ed4f 100644
--- a/packages/ckeditor5-math/src/ui/mainformview.ts
+++ b/packages/ckeditor5-math/src/ui/mainformview.ts
@@ -7,7 +7,7 @@ import {
View,
ViewCollection,
type FocusableView,
- Locale,
+ type Locale,
FocusTracker,
KeystrokeHandler
} from 'ckeditor5';
diff --git a/packages/ckeditor5-math/src/ui/mathinputview.ts b/packages/ckeditor5-math/src/ui/mathinputview.ts
index b296c86aae..a5531fca8f 100644
--- a/packages/ckeditor5-math/src/ui/mathinputview.ts
+++ b/packages/ckeditor5-math/src/ui/mathinputview.ts
@@ -160,7 +160,7 @@ export default class MathInputView extends View {
mf.readOnly = this.isReadOnly;
mf.addEventListener( 'mount', () => {
- mf.inlineShortcuts = { ...mf.inlineShortcuts, dx: 'dx', dy: 'dy', dt: 'dt' };
+ mf.inlineShortcuts = { ...mf.inlineShortcuts, dx: '', dy: '', dt: '' };
}, { once: true } );
mf.addEventListener( 'input', () => {
diff --git a/packages/ckeditor5-math/theme/mathform.css b/packages/ckeditor5-math/theme/mathform.css
index 628105078e..585b0ba702 100644
--- a/packages/ckeditor5-math/theme/mathform.css
+++ b/packages/ckeditor5-math/theme/mathform.css
@@ -2,9 +2,18 @@
* Math equation editor dialog styles
*/
-/* Ensure MathLive virtual keyboard appears above CKEditor balloon */
-.ML__keyboard {
- z-index: 10001 !important;
+/* Ensure MathLive UI (keyboard, popovers, autocomplete) appears above CKEditor balloon */
+.ML__keyboard,
+.ML__popover,
+.ML__menu,
+.ML__suggestions,
+.ML__autocomplete,
+[data-ml-root],
+/* MathLive LaTeX suggestions popover (by id, from DOM) */
+#mathlive-suggestion-popover,
+/* Potential class name variant for suggestions popover */
+.mathlive-suggestions-popover {
+ z-index: 100001 !important;
}
/* ============================================================================
@@ -18,7 +27,10 @@
box-sizing: border-box;
max-width: 80vw;
max-height: 80vh;
- overflow: hidden;
+ overflow-x: hidden;
+ /* Allow text/MathLive selection inside the dialog even though
+ the global body style sets user-select: none; */
+ user-select: text;
}
/* Mobile responsiveness */
@@ -32,6 +44,12 @@
Content Layout
========================================================================= */
+.ck-math-scroll {
+ overflow: auto;
+ flex: 1 1 auto;
+ min-height: 0;
+}
+
.ck-math-view {
display: flex;
flex-direction: column;
@@ -40,7 +58,6 @@
min-height: 0;
min-width: 0;
width: 100%;
- overflow: hidden;
}
.ck-math-button-row {
@@ -61,7 +78,8 @@
.ck.ck-math-form math-field,
.ck.ck-math-form textarea {
box-sizing: border-box;
- font-size: var(--ck-font-size-base);
+ padding: var(--ck-spacing-small);
+ background: var(--ck-color-input-background) !important;
color: var(--ck-color-input-text, inherit);
background: transparent !important;
border: none !important;
@@ -106,22 +124,10 @@
}
/* ============================================================================
- MathLive Configuration
+ MathLive Visual Editor
========================================================================= */
-/* Configure MathLive shadow DOM layout */
-.ck.ck-math-form math-field::part(container),
-.ck.ck-math-form math-field::part(content),
-.ck.ck-math-form math-field::part(field) {
- display: flex;
- flex-direction: column;
- flex: 1 1 auto;
- height: 100%;
- align-items: flex-start;
- justify-content: flex-start;
-}
-
-/* Position MathLive UI controls */
+/* Position MathLive UI controls (keep default internal layout and sizing) */
.ck.ck-math-form math-field::part(virtual-keyboard-toggle),
.ck.ck-math-form math-field::part(menu-toggle) {
position: absolute;
@@ -149,7 +155,6 @@
width: 100%;
flex: 1 1 auto;
min-height: 0;
- overflow: hidden;
}
.ck.ck-math-input .ck-mathlive-container {
@@ -207,15 +212,10 @@
background: transparent !important;
border: none !important;
padding: 0;
- box-shadow: none !important;
- transition: none !important;
- animation: none !important;
}
.ck.ck-math-input .ck-latex-textarea:focus {
outline: none;
- box-shadow: none !important;
- transition: none !important;
}
/* ============================================================================
@@ -233,7 +233,7 @@
}
/* ============================================================================
- Preview Section (always at bottom)
+ Preview Section
========================================================================= */
.ck-math-preview {