Skip to content

Commit

Permalink
wrap decorator resizeobserver in RAF
Browse files Browse the repository at this point in the history
  • Loading branch information
chocolatkey committed Sep 19, 2023
1 parent 37594d7 commit cf2a481
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion navigator-html-injectables/src/modules/Decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export class Decorator extends Module {
ack(true);
});

this.resizeObserver = new ResizeObserver(() => this.handleResize());
this.resizeObserver = new ResizeObserver(() => wnd.requestAnimationFrame(() => this.handleResize()));
this.resizeObserver.observe(wnd.document.body);
wnd.addEventListener("orientationchange", this.handleResizer);
wnd.addEventListener("resize", this.handleResizer);
Expand Down

0 comments on commit cf2a481

Please sign in to comment.