fix: guard against document being undefined in embed-iframe informAboutScroll (#28596)

* fix: guard against document being undefined in informAboutScroll to fix flaky test

* fix: update comment to not reference test environment
This commit is contained in:
Sahitya Chandra
2026-03-27 11:50:35 +00:00
committed by GitHub
parent 15005d89bd
commit b436f331c7
@@ -66,6 +66,10 @@ export function keepParentInformedAboutDimensionChanges({ embedStore }: { embedS
let isInitialDimensionPass = true;
let isWindowLoadComplete = false;
runAsap(function informAboutScroll() {
// Can't inform parent about dimensions if document doesn't exist
if (typeof document === "undefined") {
return;
}
if (document.readyState !== "complete") {
// Wait for window to load to correctly calculate the initial scroll height.
runAsap(informAboutScroll);