Resizing frame for general page module

I’m developing an addon with ACE, and I have a problem with auto-resizing. I’m using this information about resize, which is similar to Jira but it’s work only for Jira Cloud -https://developer.atlassian.com/cloud/confluence/modules/page/.

In Confluence, I need to use AP.sizeToParent method for getting full height for iframe, but sometimes I need to use setTimeout for using this method after my React module mounted. How can I set full height for iframe before my page load?

When I’m not using this method iframe is always has minimal height and width.

5 Likes

We have had this problem as well, even when we wait for both window.load and other DOM rendering to complete. Some percentage if the time the reside never occurred. Using setTimeout is the only work around I have found. Would love to learn of a better answer!

Also, as an aside, using resize as a data-options property only works if the dom actually resizes after the initial page render, probably because it’s triggered by a mutation observer, so we have had to resort to an initial manual resize call or setTimeouts in those cases as well.

2 Likes

Hi @BobBergman,

Did you by any chance find the cause of the issue? Or a perfect solution? We have posted this link a while ago but didn’t hear from anyone:

Also, did you notice this appearing in the last few months? We never had resize problems before and it started appearing only in the last few months.

Thanks for any help!

Yves

1 Like

I’ve been working with various teams inside Atlassian to fix this issue. This turned out to be a complex issue to fix and required numerous updates to roll out to production. I believe we are just waiting on a few more updates to land in production before we can validate this as fixed.

1 Like

Thanks @rwhitbeck!

That is good news. Do you have a ticket that we can point our customer to? I didn’t find any. We only saw this appearing in the last few months. Was this caused by an update?

Thanks again!

Yves

1 Like

It’s late here so now I’m just making sure this issue is the same as this one "sizeToParent" general pages have the wrong height on Cloud Which has the Jira ticket. If that’s the same issue with the new nav then that fix is trying to roll out.

Can you let me know if this is the same issue?

I think the OP is referring to the need to sometimes call setTimeout sometime after initial window load to get AP.sizeToParent() to have any effect at all. I think that’s a different issue than them having the wrong height after invoking it. It’s as if there’s a race condition on the parent page side in responding to the resize vent coming across the xdm bridge.

Possibly related, I have noticed that using data-options="resize: true"only works if the DOM is mutated after initial window load. If you don’t mutate the DOM after load with JS that doesn’t trigger and you have to all AP.resize() yourself.

Hi @rwhitbeck, our issue also does not seem the same as the one you’ve linked to. We’ve started to see this problem a few months ago before the new nav was probably available even in beta. Along the way we saw some resize-related functions (like the ‘ac-content’ CSS style and the AP.sizeToParent()) break, which could have actually been manifestations of some internal changes Atlassian did while preparing the new nav roll-out, but we can’t be sure, obviously.

2 Likes