Preview gets cut off sometimes on a layout change

Created on 2 April 2025, 10 days ago

Overview

Sometimes when you make a change to the layout, the preview's height suddenly get cut off. I don't have explicit steps to reproduce this but it happens often enough that it shouldn't be hard to reproduce.

When I checked the DOM of the cut off previewContainer, the height is set to auto. On a preview that isn't cut off, the height of the previewContainer is set to a value.


Proposed resolution

Revisit useSyncIframeHeightToContent.ts.

Below code is resizeIframe() inside of useSyncIframeHeightToContent from useSyncIframeHeightToContent.ts

Instead of

previewContainer.style.height = iframeHTML?.offsetHeight
            ? `${iframeHTML.offsetHeight}px`
            : 'auto';

See if removing the ternary helps and set the offsetHeight value every time?

        iframe.style.height = iframeHTML.offsetHeight + 'px';

User interface changes

πŸ› Bug report
Status

Active

Version

0.0

Component

Page builder

Created by

πŸ‡ΊπŸ‡ΈUnited States hooroomoo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024