iframe-resizer icon indicating copy to clipboard operation
iframe-resizer copied to clipboard

iFrame height not always correct on iOS devices.

Open godsdog opened this issue 5 years ago • 5 comments

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!

godsdog avatar Jun 25 '20 14:06 godsdog

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,

godsdog avatar Jun 26 '20 13:06 godsdog

Same problem here. We need this issue fixed soon too!

HenLab avatar Jun 26 '20 20:06 HenLab

I would welcome a PR if you work out what the issue is

davidjbradshaw avatar Jun 27 '20 18:06 davidjbradshaw

Can you take a look to the ipad remote console?

  1. Wrong height: debug-iframe-1

  2. Correct height after rotating the ipad: debug-iframe-2

I am not sure where to start to investigate further.

godsdog avatar Jun 29 '20 14:06 godsdog

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);

godsdog avatar Jun 30 '20 12:06 godsdog

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.

davidjbradshaw avatar Feb 22 '24 18:02 davidjbradshaw