Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
Fix differential d problems
meinzzzzf8d84814e079
diff --git a/packages/ckeditor5-math/src/ui/mathliveinputview.ts b/packages/ckeditor5-math/src/ui/mathliveinputview.tsindex a3863077cd..f761be787d 100644--- a/packages/ckeditor5-math/src/ui/mathliveinputview.ts+++ b/packages/ckeditor5-math/src/ui/mathliveinputview.ts@@ -8,7 +8,8 @@ interface MathFieldElement extends HTMLElement {value: string;readOnly: boolean;mathVirtualKeyboardPolicy: string;-+ // Interface includes the shortcuts property+ inlineShortcuts: Record<string, string>;}/**@@ -56,11 +57,23 @@ export default class MathLiveInputView extends View {// 2. Configure Optionsmathfield.mathVirtualKeyboardPolicy = 'manual';- // Disable sounds+ //Disable differential D+ mathfield.addEventListener( 'mount', () => {+ mathfield.inlineShortcuts = {+ ...mathfield.inlineShortcuts, // Safe to read now+ dx: 'dx',+ dy: 'dy',+ dt: 'dt'+ };+ } );+++ // Disable sounds safelyconst MathfieldConstructor = customElements.get( 'math-field' );if ( MathfieldConstructor ) {- ( MathfieldConstructor as any ).soundsDirectory = null;- ( MathfieldConstructor as any ).plonkSound = null;+ const proto = MathfieldConstructor as any;+ if ( proto.soundsDirectory !== null ) proto.soundsDirectory = null;+ if ( proto.plonkSound !== null ) proto.plonkSound = null;}// 3. Set Initial State@@ -84,7 +97,7 @@ export default class MathLiveInputView extends View {mathfield.readOnly = nextValue;} );- // 6. Mount+ // 6. Mount to the wrapper viewthis.element?.appendChild( mathfield );this.mathfield = mathfield;}