Skip to content

Commit

Permalink
Merge branch 'main' into fix/totp-google
Browse files Browse the repository at this point in the history
  • Loading branch information
leog committed Mar 4, 2023
2 parents 06932e3 + 4366405 commit ad24062
Show file tree
Hide file tree
Showing 4 changed files with 221 additions and 119 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/e2e-embed.yml
Expand Up @@ -32,12 +32,12 @@ jobs:
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: test-results-core
name: test-results-embed-core
path: packages/embeds/embed-core/playwright/results

- name: Upload embed-react results
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: test-results-react
name: test-results-embed-react
path: packages/embeds/embed-react/playwright/results
4 changes: 2 additions & 2 deletions packages/embeds/embed-core/src/Inline/inlineHtml.ts
@@ -1,5 +1,5 @@
const html = `<div id="wrapper" style="top:50%; left:50%" class="absolute z-highest">
<div style="transform:translate(-50%,-50%)" class="loader border-brand dark:border-darkmodebrand">
const html = `<div id="wrapper" style="top:50%; left:50%;transform:translate(-50%,-50%)" class="absolute z-highest">
<div class="loader border-brand dark:border-darkmodebrand">
<span class="loader-inner bg-brand dark:bg-darkmodebrand"></span>
</div>
<div id="error" style="transform:translate(-50%,-50%)" class="hidden">
Expand Down
11 changes: 9 additions & 2 deletions packages/embeds/embed-core/src/embed-iframe.ts
Expand Up @@ -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 =
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.
Expand Down

0 comments on commit ad24062

Please sign in to comment.