Hi,
I am developing an app for confluence. When I open a modal on this way:
AP.dialog.create({ key: 'dialog-confirm-spacepub' })
and render inside content using @atlaskit/modal-dialog, I check that inside the iframe, the body has a weird hardcoded margin via style.
<body style="background-color: transparent; border: 0px; margin: 10px 10px 0px !important;">
This makes for a fraction of second, displaying scrollbars that disappear once the modal content is loaded.
Does anybody know where that margin comes from? And how can I avoid it?
EDIT: I have just checked that the file all.js served from Atlassian has this code:
var margin = combined._data.options.isDialog ? '10px 10px 0 10px' : '0';
if (consumerOptions.get('margin') !== false) {
var setBodyMargin = function setBodyMargin() {
if (document.body) {
document.body.style.setProperty('margin', margin, 'important');
}
};
setBodyMargin(); // Try to set it straight away
window.addEventListener('DOMContentLoaded', setBodyMargin); // If it doesn't exist now (likely) we can set it later
}
If someone knows how to avoid this behaviour.
Thanks.