From 0528516f54a00a5bb0299669a73485e92ce7eb57 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Mon, 5 Aug 2024 14:12:15 +0200 Subject: [PATCH] Schedule an editor measure on document.fonts.ready FIX: Avoid the editor's geometry measurements becoming incorrect when fonts finish loading by scheduling a measure on `document.fonts.ready`. Issue https://github.com/codemirror/dev/issues/1421 --- src/editorview.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/editorview.ts b/src/editorview.ts index 965b486..0ca9253 100644 --- a/src/editorview.ts +++ b/src/editorview.ts @@ -214,6 +214,7 @@ export class EditorView { this.updateState = UpdateState.Idle this.requestMeasure() + if (document.fonts?.ready) document.fonts.ready.then(() => this.requestMeasure()) } /// All regular editor state updates should go through this. It