Modal Page position not relative to screen height | Community
Skip to main content
Level 2
Dec 15, 2020 11:44 PM UTC
Solved

Modal Page position not relative to screen height

I'm trying to create a modal component for my page in AEM. Everything works great. The modal js builds the code in the DOM at the bottom of the page as a direct child of the <body>. Normally with heights at 100% I can position the modal in the middle of the screen, however, the source code of AEM shows that the height of a parent iframe and div are set automatically based on the content. This makes it difficult to position based on the window height. Is there a way around this?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
pmueller8Accepted solution
Level 2
Dec 16, 2020 9:34 PM UTC

So, I found the solution. I was going to delete this but then thought, it may help someone in the future. The solution is that the preview mode is the only place the iframe exists. Once you view it  published, the iframe goes away and there isn't a problem anymore. 

2 replies

pmueller8AuthorAccepted solution
Level 2
Dec 16, 2020 9:34 PM UTC

So, I found the solution. I was going to delete this but then thought, it may help someone in the future. The solution is that the preview mode is the only place the iframe exists. Once you view it  published, the iframe goes away and there isn't a problem anymore. 

Translate
kautuk_sahni
Employee
Jan 8, 2021 10:52 AM UTC
Thank you for sharing the solution with community.
Translate
Kautuk Sahni