We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a0f0b4f commit 72d6f97Copy full SHA for 72d6f97
app/components/artifact.tsx
@@ -48,14 +48,12 @@ export function HTMLPreview(props: {
48
}, []);
49
50
const height = useMemo(() => {
51
- const parentHeight = props.height || 600;
52
- if (props.autoHeight !== false) {
53
- return iframeHeight + 40 > parentHeight
54
- ? parentHeight
55
- : iframeHeight + 40;
56
- } else {
57
- return parentHeight;
+ if (!props.autoHeight) return props.height || 600;
+ if (typeof props.height === "string") {
+ return props.height;
58
}
+ const parentHeight = props.height || 600;
+ return iframeHeight + 40 > parentHeight ? parentHeight : iframeHeight + 40;
59
}, [props.autoHeight, props.height, iframeHeight]);
60
61
const srcDoc = useMemo(() => {
0 commit comments