Dynamic Container for Iframe

maybe Calculation would work for you?

https://www.editorxcommunity.com/forum/releases-and-announcements/new-feature-alert-calculation-for-size-units

https://support.wix.com/en/article/editor-x-setting-the-size-of-your-element#using-calculation-to-determine-the-size-of-your-elements