mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-17 16:15:22 +00:00
Fix an issue where iframe aspect ratio was not respected. (#2979)
This commit is contained in:
@@ -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',
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user