Skip to content

Commit

Permalink
fix: better manage iframe margin
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomontalbano committed Dec 18, 2024
1 parent 8c70f74 commit 052fab1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/drop-in/src/components/cl-cart/cl-cart.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('cl-cart.spec', () => {
id="iFrameResizer0"
allow="payment"
src="https://example.com/checkout-url"
style="width: 1px; min-width: 100%; min-height: 100%; border: none; overflow: hidden;"
style="width: 1px; min-width: calc(100% - 40px); min-height: 100%; border: none; margin: 20px; overflow: hidden;"
></iframe>
</div>
</mock:shadow-root>
Expand Down Expand Up @@ -70,7 +70,7 @@ describe('cl-cart.spec', () => {
title="My Cart"
id="iFrameResizer1"
allow="payment"
style="width: 1px; min-width: 100%; min-height: 100%; border: none; overflow: hidden;"
style="width: 1px; min-width: calc(100% - 40px); min-height: 100%; border: none; margin: 20px; overflow: hidden;"
></iframe>
</div>
</mock:shadow-root>
Expand All @@ -93,7 +93,7 @@ describe('cl-cart.spec', () => {
id="iFrameResizer1"
allow="payment"
src="https://example.com/checkout-url"
style="width: 1px; min-width: 100%; min-height: 100%; border: none; overflow: hidden;"
style="width: 1px; min-width: calc(100% - 40px); min-height: 100%; border: none; margin: 20px; overflow: hidden;"
></iframe>
</div>
</mock:shadow-root>
Expand Down
7 changes: 3 additions & 4 deletions packages/drop-in/src/components/cl-cart/cl-cart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,6 @@ export class ClCart {
{
checkOrigin: false,

bodyPadding: '20px',

// 'messageCallback' has been renamed 'onMessage'. The old method will be removed in the next major version.
// @ts-expect-error We are using the latest version for 'iframe-resized' but unfortunately types are not updated.
onMessage
Expand Down Expand Up @@ -273,9 +271,10 @@ export class ClCart {
src={this.href}
style={{
width: '1px',
'min-width': '100%',
'min-width': 'calc(100% - 40px)',
'min-height': '100%',
border: 'none'
border: 'none',
margin: '20px'
}}
></iframe>
</div>
Expand Down

0 comments on commit 052fab1

Please sign in to comment.