lloydzhou 1 год назад
Родитель
Сommit
47b33f2b17
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      app/components/artifact.tsx

+ 4 - 2
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;