resizeIframe

Updated:

Updates the containing iFrame's height to match the height of the content.

Description

The resizeIframe function updates your extension's <iframe> height to match the height of the content. It uses document.body.scrollHeight or document.documentElement.scrollHeight (whichever is smaller) and applies the height to the style attribute of the <iframe>. Tecton will automatically fire this in the background on the page load and resize events. Additionally, we apply a ResizeObserver to watch for changes to the height of the document.body and update the <iframe> height from those as well.

Signature

tecton.actions.resizeIframe(): void;

Usage

Manually trigger a resize calculation if content has changed dynamically.

tecton.actions.resizeIframe();

Additional Information

When using the resizeIframe action, there are important details to keep in mind.

Set Heights

We advise against setting a height or max-height on elements that contain the content (e.g., document, body, <main>), as that will override the container's ability to update with resizeIframe. This can cause things like forcing an inner scrollbar.

Release Notes

Tecton
0.16.5
Tecton
1.34.0
Tecton
1.38.0

Platform Support

UUX
Config
Console

Frequently Asked Questions

There are 2 frequently asked questions related to this page.