From 47b33f2b1733a39a6bbf25f14006e3bbb1c1dde3 Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Thu, 25 Jul 2024 14:15:16 +0800 Subject: [PATCH] hotfix: auto set height --- app/components/artifact.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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;