Skip to main content
May 18, 2016

AEM 6.1 SP1 Component height not calculated correctly in edit mode touch UI

  • May 18, 2016
  • 26 replies
  • 15267 views

Hi,

I have component which is displayed correctly on AEM 6.1. However, when I moved it to AEM 6.1 SP1 server, it caused display problem on edit mode on touch UI. The display problem happened on Edit mode on touch UI. it is fine for the preview mode and the classic UI.

After comparing the difference between the AEM 6.1 SP1 and AEM 6.1, I noticed div and iframe height calculated from the AEM 6.1 SP1 seems wrong for this page.

In AEM 6.1 SP1 server:

<div id="ContentWrapper" style="height: 662px;">
    <div id="FullScreenMask" style="display: none;"></div>
    <iframe width="100%" height="500" frameborder="0" allowfullscreen="" id="ContentFrame" src="/content/xxx/testhome.html" style="height: 662px;"></iframe>
</div>

while in AEM 6.1, it is

<div id="ContentWrapper" style="height: 4276px;">
    <div id="FullScreenMask" style="display: none;"></div>
    <iframe width="100%" height="500" frameborder="0" allowfullscreen="" id="ContentFrame" src="/content/xxx/testhome.html" style="height: 4276px;"></iframe>
</div>

Any suggestion for fix this?

Thanks in advance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

26 replies

taggat4023
New Participant
March 7, 2018

I have just had the same problem with AEM 6.2 SP1 and put this in place in one of the client libs for the widgets

(function ($, ns, channel, window, undefined) {

    "use strict";

    $('#ContentFrame').load(function() {

    $('#ContentFrame').height($('#ContentFrame')[0].contentWindow.document.body.scrollHeight+"px");

});

}(jQuery, Granite.author, jQuery(document), this));

New Participant
September 18, 2018

Is this issue has been fixed? I am facing a similar issue in AEM 6.4

New Participant
September 21, 2018

Not for me. Thanks

New Participant
February 27, 2018

Hi folks,

I found fix for AEM 6.1 for Edit mode view.

Just add right styles for html, body tags in <iframe>.

html, body {
  1.    margin: 0;
  2.    padding: 0;

html {
  1.    height: 100%;

body {
  1.    height: auto;
smacdonald2008
New Participant
September 27, 2018

WHen this type of issue happens for a custom component - look at the CSS. Also - is anyone seeing this happen on AEM CORE Components?

New Participant
December 6, 2017

Is there any update on this issue ? We are facing a similar issue

New Participant
September 18, 2017

Hi,

This bug is also happening in AEM 6.3. Can anyone tell me if there's a hotfix I can install to get this resolved?

Thank you, I appreciate it.

smacdonald2008
New Participant
September 18, 2017

I would contact Support to see if a hotfix is needed.

New Participant
September 18, 2017

Thank you. I will contact Support then. Thanks a lot!

New Participant
August 3, 2017

We were using Material Design Lite. With the help of Adobe Support, we identified this class as the culprit:

.mdl-layout__container {

    position: absolute;

    width: 100%;

    height: 100%;

}

I had to remove it completely (showed up twice in the OOTB MDL CSS), but that did the trick.

kautuk_sahni
Employee
May 9, 2017

It is a known bug, Please create a daycare ticket for this.

Some Workarounds:-

1. introduce page refresh when switching to preview, as pointed out in this blog article
2. implement at project level a new action in the page header, as mentioned in the documentation that opens the page with ?wcmmode=disabled (removing the editor.html and adding ?wcmmode=disabled works)

"View as published" feature got  introduced from AEM 6.2, please re;quest for back porting.

I hope this would help.

~kautuk

Kautuk Sahni
New Participant
May 9, 2017

But If we want to open the page in Touch UI editor mode only?

New Participant
June 29, 2017

Find the styling class that applies negative margin-bottom value and exclude it in edit mode.

New Participant
May 9, 2017

Running into this issue with AEM 6.2 as well.

UPDATE:

The issue is in "/libs/cq/gui/components/authoring/editors/clientlibs/core.js" the "currentHeight" is always equal to the "targetHeight" so no resizing takes place.
 

/** * Resets the height of the ContentWrapper and ContentFrame; used to adjust the iframe height when a change occurs inside of the content page * This is called on cq-contentframe-layout-change event * * @memberOf Granite.author.ContentFrame * @alias resetContentHeight */ self.resetContentHeight = function () { var document = self.getDocument().get(0); var getDocumentHeight = function(doc) { return Math.max(doc.body.scrollHeight, doc.documentElement.scrollHeight, doc.body.offsetHeight, doc.documentElement.offsetHeight); }; if (document) { var currentHeight = self.iframe.height(); var targetHeight = getDocumentHeight(document); // Height of the iframe content var editorHeight = $(window).height() - self.topOffset; // Height of the editor (window - toolbar) if (targetHeight < editorHeight) { targetHeight = editorHeight; } if (currentHeight !== targetHeight) { window.requestAnimationFrame(function () { self.wrapper.height(targetHeight); self.iframe.height(targetHeight); }); } } };
kautuk_sahni
Employee
May 8, 2017

I have asked internal team to have a look at this one.

~kautuk

Kautuk Sahni
New Participant
September 26, 2018

Hi kautuk sahni,

Although this is a very late time to response on this thread, but i assume i would still be able to find solutions to similar items.

Let me give you a brief idea to you on the issues we are facing.

We are currently upgrading from 6.2 to 6.4.

Now in 6.2 we had few components which were having floating CSS properties.

So if a floated component was dropped and after that any non-floated component was dropped, everything was working fine.

the "editable zone"(blue border) of non-floated element was overlapping the editable zone of floated component, but still they both were individually clickable.

but in 6.4 some how the floated element is not clickable and overlapped component is always in the mouse hover precedence.

We drilled down more and found that the div("data-type='Editable'") order/sequence of both components (floated followed by non-floated) is reversed in 6.4 when compared to 6.2 and since the z-index of both components is 10, it will give priority to the top level element always.

So can you suggest any work around to this of a genuine fix with which the editable zone allows the mouse hover and click events on the original component.

Regards,

Sumit

anuj_khanna_77
New Participant
May 8, 2017

Guys,

 

Is this a known issue and reported with AEM 6.1 SP. Can you point me to the known issues listing where this is listed.

New Participant
May 3, 2017

Hi,

I was also facing the same issue with AEM 6.2 in Touch UI edit mode, Height of ContentWrapper and iframe was increasing drastically throughout the site.

The reason was, we were using a css class in our base page with the below properties, which was somehow impacting the ContentWrapper class:

.wrapper {position: relative;min-height: 100%;margin: 0 auto -298px; }

here, the bottom margin was given in -ve that's why height of ContentWrapper and iframe was increasing drastically in author mode.

To fix this issue, setting the bottom margin property to positive value solved the problem as in below example:

.wrapper {position: relative;min-height: 100%;margin: 0 auto 0px; }

Note: The ContentWrapper class is only added in Touch UI edit mode that's why the issue was coming only in this mode not in classic and preview mode.