Expand my Community achievements bar.

SOLVED

Universal editor and vh units

Avatar

Level 1

 Hi,

I'm actually implementing the new universal editor on a website with some sections who have their height defined in vh units (viewport height). The problem is, when in the iframe of the editor, the editor seems to try to resize the iframe to the total height of the website but doing this cause the section with height defined in vh to expand more and triggering a new iframe resize who will made the section in vh to expand again entering in an endless loop expanding the iframe infinitely.

I would like to know if someone has already faced this problem and if there is a perennial fix to this problem (all I've tried create more problems).

 Thanks for your responses.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Yeah, I haven't gotten involved with the UE just yet, but I will give it a try soon and will check if there is anything else that I can advise on, let me know your findings, sounds like you are already on top of it.



Esteban Bustamante

View solution in original post

4 Replies

Avatar

Community Advisor

Hi, 

I have encountered this problem several times in the regular AEM Author page editor when using VH units. In this case, the only solution that worked for me was to set a fixed height when using the editor mode. So, using HTL, I implemented something like this:

<div class="${wcmmode.edit ? 'myClassWithFixedHeight' : ''}">....</div>

To address this issue, you should follow the same pattern. Check for a class that is only present in the Universal Editor. This will help you determine when you are in the Universal Editor mode, allowing you to set a fixed height accordingly.

 

Hope this helps.



Esteban Bustamante

Avatar

Level 1

Hi, thanks for your response. I've tried this old editor fix but in the universal it seem to lead to others bugs around scrolls and iframe height. I'm trying to adapt this fix to the universal editor, i'll keep you in touch in case of success. 

Thanks again for your response.

(P.S. since i've no access to the htl anymore, there's some js events to know which mode is actually used : 'aue:ui-preview' and 'aue:ui-edit') 

Avatar

Correct answer by
Community Advisor

Yeah, I haven't gotten involved with the UE just yet, but I will give it a try soon and will check if there is anything else that I can advise on, let me know your findings, sounds like you are already on top of it.



Esteban Bustamante

Avatar

Administrator

@NilRichert Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!



Kautuk Sahni