we show an external page in the iframe of our plugin. However, the height of the iframe is not adapted to its contents - it’s always shown with a height of 150px and a vertical scrollbar.
How can I get Jira to compute and set the height of the iframe correctly?
The information you’ve shared is a little sparse. Have you tried calling AP.resize()? What does your descriptor look like? Where’s your iframe located?
<div class="h_iframe">
<iframe height="800px" frameborder="0" src="https://the-page-to-show">
Sorry, your browser does not support iframes.
</iframe>
</div>
The page which is shown has a size of approx. 1200px, but the iframe stays at 150px.
Regarding AP.resize:I understood from the docs that Atlassian connect does this automatically when iframe is rendered. At least it did when we had this issue: Jira resizes iframe height constantly
It does not work well with absolutely positioned elements. So it all depends on the content you inject in the iframe.
You might want to calculate the height on your own and use AP.resize as suggested.
The function is called, but it doesn’t change anything beside I have now a second vertical scrollbar shown.
BTW: I tried AP.resize() with and without parameters.
Update: I also tried to call AP.resize() after a delay so the page inside our iframe is completely loaded. No effect: hight is still 150
yes: I tried with ac-content and AP.resize() - with relative and absolute values. No effect. I’m currently not working on that particular project, but when I’m on it the next time I will try with that overflow-y setting.
I have been working on Confluence app lately. It seems that this only worked for me with Jira apps.
After searching around for solutions, I’ve added these attributes to my app’s javascript tag and removed the “ac-content” class from the body and AP.resize and AP.sizeToParent: