Skip to content

Commit 4ecf983

Browse files
authored
Merge pull request #991 from outoftime/frame-container
Use container div to correctly size preview iframe
2 parents d48dfe6 + 3a8bf03 commit 4ecf983

2 files changed

Lines changed: 18 additions & 11 deletions

File tree

src/components/PreviewFrame.jsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,13 @@ class PreviewFrame extends React.Component {
110110
}
111111

112112
return (
113-
<iframe
114-
className="preview__frame"
115-
sandbox={sandboxOptions}
116-
{...srcProps}
117-
/>
113+
<div className="preview__frame-container">
114+
<iframe
115+
className="preview__frame"
116+
sandbox={sandboxOptions}
117+
{...srcProps}
118+
/>
119+
</div>
118120
);
119121
}
120122
}

src/css/application.css

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -554,14 +554,19 @@ body {
554554
display: flex;
555555
}
556556

557-
.preview__frame {
558-
border: 0;
559-
z-index: 0;
560-
position: absolute;
561-
top: 1.5em;
557+
.preview__frame-container {
558+
bottom: 0;
562559
left: 0;
560+
position: absolute;
563561
right: 0;
564-
bottom: 0;
562+
top: 1.5em;
563+
z-index: 0;
564+
}
565+
566+
.preview__frame {
567+
border: 0;
568+
height: 100%;
569+
width: 100%;
565570
}
566571

567572
.preview__title-bar {

0 commit comments

Comments
 (0)