diff --git a/app/components/artifact.tsx b/app/components/artifact.tsx index b88802764..78e928200 100644 --- a/app/components/artifact.tsx +++ b/app/components/artifact.tsx @@ -37,10 +37,12 @@ export function HTMLPreview(props: { const { id, height, title } = e.data; setTitle(title); if (id == frameId.current) { - setIframeHeight(height); + if (height != iframeHeight + 40) { + setIframeHeight(height); + } } }); - }, []); + }, [iframeHeight]); const height = useMemo(() => { const parentHeight = props.height || 600;