Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/weak-onions-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@gitbook/react-contentkit": patch
---

Fix an issue where iframe aspect ratio was not respected.
10 changes: 2 additions & 8 deletions packages/react-contentkit/src/ElementWebframe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,9 @@ export function ElementWebframe(props: ContentKitClientElementProps<ContentKitWe
allow="clipboard-write"
className="contentkit-webframe"
style={{
// If given an aspect ratio, use width as auto dimension and let height take precedence.
...(aspectRatio
? {
width: 'auto',
aspectRatio,
}
: { width: '100%' }),

width: '100%',
maxWidth: '100%',
aspectRatio,
height: size.height ? Math.max(size.height, 32) : '100%',
border: 'none',
}}
Expand Down