Skip to content

Commit

Permalink
hotfix: auto set height
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydzhou committed Jul 25, 2024
1 parent 9f0e16b commit 47b33f2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/components/artifact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 47b33f2

Please sign in to comment.