We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d978f4 commit 52cfb0eCopy full SHA for 52cfb0e
1 file changed
src/LiveDevelopment/BrowserScripts/RemoteFunctions.js
@@ -961,7 +961,18 @@ function RemoteFunctions(config = {}) {
961
});
962
}
963
964
- window.addEventListener("resize", redrawEverything);
+ // Throttle resize redraws to one per animation frame — avoids redundant
965
+ // layout reads when the browser fires multiple resize events per frame.
966
+ let _pendingResizeRAF = null;
967
+ function _onWindowResize() {
968
+ if (!_pendingResizeRAF) {
969
+ _pendingResizeRAF = requestAnimationFrame(function () {
970
+ _pendingResizeRAF = null;
971
+ redrawEverything();
972
+ });
973
+ }
974
975
+ window.addEventListener("resize", _onWindowResize);
976
977
/**
978
* Constructor
0 commit comments