Skip to content

Commit c9ea239

Browse files
authored
Fix an issue where iframe aspect ratio was not respected. (#2979)
1 parent 16292de commit c9ea239

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

.changeset/weak-onions-tickle.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@gitbook/react-contentkit": patch
3+
---
4+
5+
Fix an issue where iframe aspect ratio was not respected.

packages/react-contentkit/src/ElementWebframe.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,9 @@ export function ElementWebframe(props: ContentKitClientElementProps<ContentKitWe
176176
allow="clipboard-write"
177177
className="contentkit-webframe"
178178
style={{
179-
// If given an aspect ratio, use width as auto dimension and let height take precedence.
180-
...(aspectRatio
181-
? {
182-
width: 'auto',
183-
aspectRatio,
184-
}
185-
: { width: '100%' }),
186-
179+
width: '100%',
187180
maxWidth: '100%',
181+
aspectRatio,
188182
height: size.height ? Math.max(size.height, 32) : '100%',
189183
border: 'none',
190184
}}

0 commit comments

Comments
 (0)