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: SandBox component does not work outside WordPress context. #15415

Conversation

jorgefilipecosta
Copy link
Member

@jorgefilipecosta jorgefilipecosta commented May 3, 2019

Description

Fixes: #8565

The sandbox component resizing logic required the iframe to have a style setting the widget to 100%. In the block editor context, things worked as expected because the block styles include a style that sets iframes to 100%.

iframe {
width: 100%;
}

The component should not rely on this style being available.
This PR makes sure the component sets the style it needs.

How has this been tested?

I pasted the content available on this gist https://gist.github.com/jorgefilipecosta/94673924b3c426f2a0cb3c7fa179a984 on the playground playground/src/index.js.
I verified I could read the "Content" string.

@jorgefilipecosta jorgefilipecosta added [Type] Bug An existing feature is broken. [Package] Components /packages/components labels May 3, 2019
@jorgefilipecosta jorgefilipecosta requested a review from mmtr May 3, 2019
@jorgefilipecosta jorgefilipecosta force-pushed the fix/sandbox-component-does-not-work-outside-wordpress-context branch from b07fb29 to 67de22f Compare May 3, 2019
mmtr
mmtr approved these changes May 4, 2019
Copy link
Contributor

@mmtr mmtr left a comment

Awesome, it works as expected. Thanks!

packages/components/src/sandbox/style.scss Show resolved Hide resolved
@jorgefilipecosta jorgefilipecosta merged commit 1591471 into master May 4, 2019
1 check passed
@jorgefilipecosta jorgefilipecosta deleted the fix/sandbox-component-does-not-work-outside-wordpress-context branch May 4, 2019
@youknowriad youknowriad added this to the 5.7 (Gutenberg) milestone May 10, 2019
sbardian pushed a commit to sbardian/gutenberg that referenced this issue Jul 29, 2019
…Press#15415)

The sandbox component resizing logic required the iframe to have a style setting the widget to 100%. In the block editor context, things worked as expected because the block styles include a style that sets iframes to 100%.
dd32 pushed a commit to dd32/gutenberg that referenced this issue Sep 27, 2019
…Press#15415)

The sandbox component resizing logic required the iframe to have a style setting the widget to 100%. In the block editor context, things worked as expected because the block styles include a style that sets iframes to 100%.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Bug An existing feature is broken.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants