hotfix: auto set height

This commit is contained in:
lloydzhou 2024-07-25 14:15:16 +08:00
parent 9f0e16b045
commit 47b33f2b17
1 changed files with 4 additions and 2 deletions

View File

@ -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;