-
Notifications
You must be signed in to change notification settings - Fork 8.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small Embed Fixes #7513
Small Embed Fixes #7513
Changes from 5 commits
0fc08e9
8501bf5
6d5c60a
1aa1ae8
3760bef
be9eb3d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -340,8 +340,15 @@ function keepParentInformedAboutDimensionChanges() { | |
throw new Error("Main element should be an HTMLElement"); | ||
} | ||
|
||
const contentHeight = mainElement.offsetHeight; | ||
const contentWidth = mainElement.offsetWidth; | ||
const mainElementStyles = getComputedStyle(mainElement); | ||
const contentHeight = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. offset doesn't include margin. So consider that as success page main element has margins. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh the joys :') |
||
mainElement.offsetHeight + | ||
parseInt(mainElementStyles.marginTop) + | ||
parseInt(mainElementStyles.marginBottom); | ||
const contentWidth = | ||
mainElement.offsetWidth + | ||
parseInt(mainElementStyles.marginLeft) + | ||
parseInt(mainElementStyles.marginRight); | ||
|
||
// During first render let iframe tell parent that how much is the expected height to avoid scroll. | ||
// Parent would set the same value as the height of iframe which would prevent scroll. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style="top:50%; left:50%" and style="transform:translate(-50%,-50%)" has to be on same element for center positioning to work correctly.