Skip to content

Commit

Permalink
fix(dom): Cancel the requestAnimationFrame when all roots are disconn…
Browse files Browse the repository at this point in the history
…ected (#633)
  • Loading branch information
Snuffleupagus authored Jun 25, 2024
1 parent fee2242 commit 4833994
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fluent-dom/src/dom_localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ export default class DOMLocalization extends Localization {

if (this.roots.size === 0) {
this.mutationObserver = null;
if (this.windowElement && this.pendingrAF) {
this.windowElement.cancelAnimationFrame(this.pendingrAF);
}
this.windowElement = null;
this.pendingrAF = null;
this.pendingElements.clear();
Expand Down

0 comments on commit 4833994

Please sign in to comment.