We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 763fc89 commit 7c1bc1fCopy full SHA for 7c1bc1f
app/components/artifact.tsx
@@ -37,17 +37,17 @@ export function HTMLPreview(props: {
37
const { id, height, title } = e.data;
38
setTitle(title);
39
if (id == frameId.current) {
40
- if (height != iframeHeight + 40) {
41
- setIframeHeight(height);
42
- }
+ setIframeHeight(height);
43
}
44
});
45
}, [iframeHeight]);
46
47
const height = useMemo(() => {
48
const parentHeight = props.height || 600;
49
if (props.autoHeight !== false) {
50
- return iframeHeight > parentHeight ? parentHeight : iframeHeight + 40;
+ return iframeHeight + 40 > parentHeight
+ ? parentHeight
+ : iframeHeight + 40;
51
} else {
52
return parentHeight;
53
0 commit comments