3591832: useSyncIframeHeightToContent: vh-height sections with background images cause unbounded iframe growth via feedback loop
AI-Generated: Yes (Used opencode to fix the bug).
Testing instructions
- Create a code component with this structure on 1.x:
const sizeClass = { default: 'h-[60vh]', short: 'h-[40vh]' };
export default function VhImageHero({ size = 'default' }) {
const heightClass = sizeClass[size] || sizeClass.default;
return (
<section
className={`relative flex w-full items-center justify-center overflow-hidden ${heightClass}`}
>
<div className="absolute inset-0">
<img
src="https://images.unsplash.com/photo-1542314831-068cd1dbfeeb?auto=format&fit=crop&w=1920&q=80"
alt="Hero background"
className="h-full w-full object-cover"
/>
</div>
</section>
);
}
- Add the component to a Canvas page in the editor.
- The background image takes up a disproportionate amount of vertical space.
- Apply fix in this MR to resolve the issue.
Closes #3591832