iframe-resizer
iframe-resizer copied to clipboard
iFrame height not always correct on iOS devices.
Hello,
on iOS devices like iPad Air and iPhone XS the iframe height isn't correct. The height isn't set it falls back to our css height. Sometimes after reloading the page it is but not always. When you rotate the device, the height is correct. On MAC Safari everything is fine. I can provide a link to our dev site (via email, the site is not yet published).
I saw multiple issues about this topic, non has a solution or got investigated further due to lack of inactivity. We need this issue fixed soon!
Just to mentioned: On the iframed page we use the size method to send the correct height:
if ('parentIFrame' in window) { parentIFrame.size(newHeight); }
Therefore on the parent page we use:
autoResize: false,
Same problem here. We need this issue fixed soon too!
I would welcome a PR if you work out what the issue is
Can you take a look to the ipad remote console?
-
Wrong height:

-
Correct height after rotating the ipad:

I am not sure where to start to investigate further.
We could fix it by using these lines on our iframed page:
window.iFrameResizer = {
onReady: function () {
iframeResize(); // Our custom height calculation function
}
}
Our function "iframeResize()" then uses: window.parentIFrame.size(height);
Looking at this again, my guess this was fixed by adding the onReadyStateChange event listener a while ago. So closing this issue for now, as it appears no ones else has had the same problem, but let me know if it is still an issue.