Repository navigation
Fix sandbox refresh bug - #20176
Merged
Merged
Fix sandbox refresh bug#20176
Conversation
added 2 commits
February 12, 2020 14:29
…n order to fix bug with sandbox not refreshing when passed in html changes
glendaviesnz
requested review from
ajitbohra,
chrisvanpatten,
jorgefilipecosta and
youknowriad
as code owners
February 12, 2020 01:36
youknowriad
approved these changes
Feb 12, 2020
youknowriad
left a comment
Contributor
There was a problem hiding this comment.
Confirmed the fix by programmatically updating the content attribute of an HTML block in preview mode.
Do you know if we can unit test this somehow.
Contributor
Author
Good question, will take a look. |
Contributor
Author
@youknowriad Took a while to get it rendering in a testable way - couldn't do it with mount or shallow, but act() from 'react-dom/test-utils' did the business, so a test committed using this - let me know if you know of a simpler way. |
Contributor
|
The test is looking good for me. Thanks :) |
Contributor
|
Regression: #20614 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #16831 - currently passing in new iframe html to the sandbox does not cause the component to rerender. This forces a rerender if the html prop has changed.
How has this been tested?
Tested manually using new google calendar block at Automattic/jetpack#13999 - without this patch, and with the temporary key prop to fix this issue removed updating the calendar embed url does not affect the iframe preview, with this patch the iframe preview is reloaded when embed url is changed
Types of changes
Sets the forceRerender value to false by default and sets to true if component updates and html prop has changed