Skip to content

Commit

Permalink
Use the editor's parent window when calling cancelAnimationFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
curran committed Mar 6, 2023
1 parent c89711b commit 3c62ddc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/editorview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ export class EditorView {
/// @internal
measure(flush = true) {
if (this.destroyed) return
if (this.measureScheduled > -1) cancelAnimationFrame(this.measureScheduled)
if (this.measureScheduled > -1) this.win.cancelAnimationFrame(this.measureScheduled)
this.measureScheduled = 0 // Prevent requestMeasure calls from scheduling another animation frame

if (flush) this.observer.forceFlush()
Expand Down Expand Up @@ -761,7 +761,7 @@ export class EditorView {
this.inputState.destroy()
this.dom.remove()
this.observer.destroy()
if (this.measureScheduled > -1) cancelAnimationFrame(this.measureScheduled)
if (this.measureScheduled > -1) this.win.cancelAnimationFrame(this.measureScheduled)
this.destroyed = true
}

Expand Down

0 comments on commit 3c62ddc

Please sign in to comment.