diff --git a/example/app/app/_layout.tsx b/example/app/app/_layout.tsx index e8acc0b..a4d1dbb 100644 --- a/example/app/app/_layout.tsx +++ b/example/app/app/_layout.tsx @@ -61,7 +61,9 @@ function RootLayoutNav() { if (IS_WEB && inDoc) { window.addEventListener("load", () => { const carouselComponent = document.getElementById("carousel-component"); + if (carouselComponent) { + console.log(carouselComponent.offsetHeight); window.parent.postMessage( { type: "carouselHeight", diff --git a/example/website/components/Demo.tsx b/example/website/components/Demo.tsx index bffccda..594f447 100644 --- a/example/website/components/Demo.tsx +++ b/example/website/components/Demo.tsx @@ -11,6 +11,7 @@ const ResizableIframe: React.FC = ({ pagePath }) => { const handleIframeLoad = () => { // get carousel-component height by postmessage window.addEventListener("message", (event) => { + console.log(event); if (event.data.type === "carouselHeight") { setCarouselHeight(event.data.height); setIsLoading(false); @@ -24,13 +25,13 @@ const ResizableIframe: React.FC = ({ pagePath }) => { style={{ marginTop: "24px", width: "100%", - height: carouselHeight ?? 28, + height: carouselHeight ?? 280, position: "relative", overflow: "hidden", transition: "height 0.3s ease-in-out", }} > - {isLoading &&
Loading...
} + {/* {isLoading &&
Loading...
} */}