You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Use, .height as that gives more accurate value in floating point. Also, do a ceil on the total sum so that whatever happens there is enough iframe size to avoid scroll.
532
-
constcontentHeight=Math.ceil(
533
-
parseFloat(mainElementStyles.height)+
534
-
parseFloat(mainElementStyles.marginTop)+
535
-
parseFloat(mainElementStyles.marginBottom)
536
-
);
537
-
constcontentWidth=Math.ceil(
538
-
parseFloat(mainElementStyles.width)+
539
-
parseFloat(mainElementStyles.marginLeft)+
540
-
parseFloat(mainElementStyles.marginRight)
541
-
);
542
-
543
-
// During first render let iframe tell parent that how much is the expected height to avoid scroll.
544
-
// Parent would set the same value as the height of iframe which would prevent scroll.
545
-
// On subsequent renders, consider html height as the height of the iframe. If we don't do this, then if iframe gets bigger in height, it would never shrink
// FIXME: This event shouldn't be subscribable by the user. Only by the SDK.
560
-
sdkActionManager?.fire("__dimensionChanged",{
561
-
iframeHeight,
562
-
iframeWidth,
563
-
isFirstTime,
564
-
});
565
-
}
566
-
isFirstTime=false;
567
-
// Parent Counterpart would change the dimension of iframe and thus page's dimension would be impacted which is recursive.
568
-
// It should stop ideally by reaching a hiddenHeight value of 0.
569
-
// FIXME: If 0 can't be reached we need to just abandon our quest for perfect iframe and let scroll be there. Such case can be logged in the wild and fixed later on.
570
-
runAsap(informAboutScroll);
571
-
});
572
-
}
573
-
574
490
functionmain(){
575
491
if(!isBrowser){
576
492
return;
@@ -659,7 +575,7 @@ function initializeAndSetupEmbed() {
0 commit comments