Sizing of AP.dialog.create from dynamicContentMacro

I would like to give my users the possibility to view a content macro in full screen mode.

So when a user sees my macro in the page he can click the full screen button and I open a dialog with the following JS code:

    key: 'fullScreenMacro',
    chrome: false,
    width: "100%",
    height: "100%",
    closeOnEscape: true,
    customData: {

Which opens the module defined in atlassian-connect.json:

  "modules": {
    "generalPages": [
        "key": "fullScreenMacro",
        "location": "hidden",
        "url": "?mode=fullscreen",
        "name": {
          "value": "Mind Map"

The issue now is, that the iframe that Confluence is opening does not always have a height of 100%, but rather depends on the scroll offset in the confluence page.

When the confluence page is at the top, the dialog has a height of 100%. If the page is scrolled down before opening the dialog the height of the dialog is reduced by the amount of pixels scrolled. If scrolled down to 100% of the browsers view height (100vw) the macro suddenly gets to be 100% height again.

Does look like a bug in connect to me. Anybody else seeing this or am I doing something wrong?

The sizing mechanism is terrible. Can’t you dynamically set the width and height in pixels rather than using %? i.e. window.outerWidth and window.outerHeight

Excellent idea!

Sadly, using anything else then β€œ100%” (eg β€œ99%”, 800, β€œ800”, β€œ800px”) will position the dialog 169px from the top. :thinking:

Found the culprit:

<script data-options="sizeToParent:true" src=''

sizeToParent caused the unwanted behaviour. But as I need it for other entry points into the single page application I now set it dynamically depending on the URL query string.

    var mode = new URLSearchParams("mode")
    var script = document.createElement('script');
    script.src = '';
    var attributes = mode === 'customcontent' ? 'sizeToParent:true' : 'resize:false;margin:false'
    script.setAttribute('data-options', attributes);