Library removes height:auto inline style from html and body elements
DanielStout5 opened this issue · comments
Daniel Stout commented
Describe the bug
The site being embedded in the iframe has a height:100% CSS rule applied to HTML and Body. We are overriding it via an inline style, but that's getting removed by this function:
function stopInfiniteResizingOfIFrame() {
document.documentElement.style.height = ''
document.body.style.height = ''
log('HTML & body height set to "auto"')
}
To Reproduce
- Create a page with
- Embed it in an iframe and add the iframe-resizer library
- Observe that height:auto gets removed
Expected behavior
The inline style should not be removed if its value is auto
David J. Bradshaw commented
Yeah if you set those properties it can cause havoc with keeping tabs on the size of the content in the iFrame. This code is their to protect you from that.