Skip to content

Commit 4833994

Browse files
fix(dom): Cancel the requestAnimationFrame when all roots are disconnected (#633)
1 parent fee2242 commit 4833994

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fluent-dom/src/dom_localization.js

+3
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ export default class DOMLocalization extends Localization {
168168

169169
if (this.roots.size === 0) {
170170
this.mutationObserver = null;
171+
if (this.windowElement && this.pendingrAF) {
172+
this.windowElement.cancelAnimationFrame(this.pendingrAF);
173+
}
171174
this.windowElement = null;
172175
this.pendingrAF = null;
173176
this.pendingElements.clear();

0 commit comments

Comments
 (0)