mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-12-29 11:52:34 +08:00
fix(email): Fix email body height bug #1280
Summary: Some emails were having their body height set to 0 if their height was dependent upon the iframe height -- e.g. body.height equals 100% or inherit. Added a check to see if height computed to 0px and if so, set the height to auto. Test Plan: Tested with emails on my computer Reviewers: juan Reviewed By: juan Differential Revision: https://phab.nylas.com/D3100
This commit is contained in:
parent
34bf11d9c0
commit
cd1f39f2fa
1 changed files with 7 additions and 0 deletions
|
@ -101,6 +101,13 @@ export default class EmailFrame extends React.Component {
|
|||
let height = 0;
|
||||
|
||||
if (doc && doc.body) {
|
||||
// Why reset the height? body.scrollHeight will always be 0 if the height
|
||||
// of the body is dependent on the iframe height e.g. if height ===
|
||||
// 100% in inline styles or an email stylesheet
|
||||
const style = window.getComputedStyle(doc.body)
|
||||
if (style.height === '0px') {
|
||||
doc.body.style.height = "auto"
|
||||
}
|
||||
height = doc.body.scrollHeight;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue