Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with iframe inside a div with display:none in Chrome 65 #567

Closed
aleen42 opened this issue Mar 14, 2018 · 10 comments
Closed

Issue with iframe inside a div with display:none in Chrome 65 #567

aleen42 opened this issue Mar 14, 2018 · 10 comments
Labels

Comments

@aleen42
Copy link

aleen42 commented Mar 14, 2018

Recently, Chrome has release version 65, and it seems to be confusing when using iframe-resizer. The problem is that when I wrap an iframe with a div element, it will be set with a small height when the div element is set to be hidden with display: none;, and in some machines, resizedCallback of iframe-resizer is not called when the div element is set with display: block; again. It seems that Chrome 65 has changed some rendering way resulting in this problem, and I hope to open this issue to help authors of iframe-resizer to research the problem and even to report a bug for Chrome.

@aleen42
Copy link
Author

aleen42 commented Mar 14, 2018

It seems that in Chrome 65, using lowestElement for calcuating height is too slow in some machines, resulting in mising calling of resizedCallback, and I use taggedElement to workaround this temporarily.

@davidjbradshaw
Copy link
Owner

Have you tried using visibility: hidden instead?

Would be great if you could open a bug with Chrome for this

@aleen42
Copy link
Author

aleen42 commented Mar 15, 2018

I try it later, but I don't understand why lowestElement option does not work under Chrome 65?

@aniude
Copy link
Contributor

aniude commented Mar 16, 2018

see the PR: #568

@davidjbradshaw
Copy link
Owner

Thanks will try and find sometime over the weekend to push an updated release

@elalemanyo
Copy link

elalemanyo commented Oct 5, 2018

Hi,
I am having the same error using Chrome 69. When I set div to display:block again the height is not the right one. Using lowestElement or taggedElement is not helping. With max the bug is gone but the height is too much...
Any idea?

Thanks!

@davidjbradshaw
Copy link
Owner

Have you tried using visibility: hidden rather than display: none?

If all else fails you can force the iFrame to resize from the parent page.
https://github.com/davidjbradshaw/iframe-resizer#resize

@elalemanyo
Copy link

I am showing the iframe inside one tab, the problem is happening when I switch to the other tab and after that I come back to the tab where the iframe is showing up, than the height from the iFrame is just 20px. I am not sure if I can easily use visibility: hidden instead of display: none, because visibility: hidden is still taking up space on the page and that would break the tab functionality.
Also I am not sure how I can access the iFrameResizer object to force the resize from the tabs script.

@davidjbradshaw
Copy link
Owner

document.getElementById('myIframe').iframeResizer.resize()

@elalemanyo
Copy link

Thanks for your tips. At the end I force iFrame resize and looks good now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants