Skip to content

Commit 47b33f2

Browse files
committed
hotfix: auto set height
1 parent 9f0e16b commit 47b33f2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/components/artifact.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ export function HTMLPreview(props: {
3737
const { id, height, title } = e.data;
3838
setTitle(title);
3939
if (id == frameId.current) {
40-
setIframeHeight(height);
40+
if (height != iframeHeight + 40) {
41+
setIframeHeight(height);
42+
}
4143
}
4244
});
43-
}, []);
45+
}, [iframeHeight]);
4446

4547
const height = useMemo(() => {
4648
const parentHeight = props.height || 600;

0 commit comments

Comments
 (0)