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

Fix collapsing html email preview #351

Merged

Conversation

RobinClowers
Copy link
Contributor

In some cases, the css of an email may cause the document.body.clientHeight to report 0, which collapses the email preview iframe. Using contentWindow.outerHeight seems to work around
this issue. Fixes #350.

In some cases, the css of an email may cause the
`document.body.clientHeight` to report 0, which collapses the email
preview iframe. Using `contentWindow.outerHeight` seems to work around
this issue.
Copy link
Contributor

@paulcsmith paulcsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find. Thank you so much

@paulcsmith paulcsmith merged commit 6427374 into beam-community:master Feb 27, 2018
germsvel pushed a commit that referenced this pull request Feb 15, 2021
What changed?
----------------

This commit uses the `screen.availHeight` property as a fallback 
to how we currently set the iframe's height. See [screen docs]. 

[Screen docs]: https://developer.mozilla.org/en-US/docs/Web/API/Screen

Why?
-------

As part of the Wallaby feature test I've needed to read an email, 
but I could only get iframe element using 
`Wallaby.Query.css("iframe", visible: false)` because the height 
of the element is 0.

I've tried this in multiple versions of Chrome and chromedriver. 
Also, I've only been able to experience this in headless Chrome 
in macOS. I wasn't having this issue with Wallaby option 
headless: false nor on a CI instance running Ubuntu.

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

Successfully merging this pull request may close these issues.

2 participants