Fix an issue where iframe aspect ratio was not respected. (#2979)

This commit is contained in:
Steven H
2025-03-13 14:23:50 +00:00
committed by GitHub
parent 16292def79
commit c9ea23919e
2 changed files with 7 additions and 8 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@gitbook/react-contentkit": patch
---
Fix an issue where iframe aspect ratio was not respected.
@@ -176,15 +176,9 @@ export function ElementWebframe(props: ContentKitClientElementProps<ContentKitWe
allow="clipboard-write" allow="clipboard-write"
className="contentkit-webframe" className="contentkit-webframe"
style={{ style={{
// If given an aspect ratio, use width as auto dimension and let height take precedence. width: '100%',
...(aspectRatio
? {
width: 'auto',
aspectRatio,
}
: { width: '100%' }),
maxWidth: '100%', maxWidth: '100%',
aspectRatio,
height: size.height ? Math.max(size.height, 32) : '100%', height: size.height ? Math.max(size.height, 32) : '100%',
border: 'none', border: 'none',
}} }}