Skip to content

Commit

Permalink
Schedule an editor measure on document.fonts.ready
Browse files Browse the repository at this point in the history
FIX: Avoid the editor's geometry measurements becoming incorrect when fonts
finish loading by scheduling a measure on `document.fonts.ready`.

Issue codemirror/dev#1421
  • Loading branch information
marijnh committed Aug 5, 2024
1 parent 9bbb116 commit 0528516
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/editorview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0528516

Please sign in to comment.