Skip to content

Commit

Permalink
Merge pull request #4916 from WordPress/try/fix-codepen-embed-width
Browse files Browse the repository at this point in the history
Fix codepen embeds width
  • Loading branch information
jasmussen authored Feb 7, 2018
2 parents 38f64cc + 31d2dc4 commit 0a73fb9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions components/sandbox/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
This component is used to embed embeds!

#### To test

Embed the following:

- Short tweet: https://twitter.com/notnownikki/status/876229494465581056
- Long tweet with media: https://twitter.com/PattyJenks/status/874034832430424065
- Video: https://www.youtube.com/watch?v=PfKUdmTq2MI
- Photo: https://cloudup.com/cQFlxqtY4ob
- Long tumblr post: http://doctorwho.tumblr.com/post/162052108791
- Create a custom html block with the following content: <img src="https://cldup.com/G3fFjtKEKe-3000x3000.jpeg">

This tests that HTML is written into the sandbox correctly in all cases, and that sites that do responsive resizes (e.g. tumblr) don't mess up when put into a small iframe that is also trying to resize.
1 change: 1 addition & 0 deletions components/sandbox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export default class Sandbox extends Component {
} );
document.body.style.position = 'absolute';
document.body.style.width = '100%';
document.body.setAttribute( 'data-resizable-iframe-connected', '' );
sendResize();
Expand Down

0 comments on commit 0a73fb9

Please sign in to comment.