-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Block Library: Avoid setting Embed className when empty, non-responsive #13706
Conversation
Previously: #6932 We wanted to discourage developers from adding artificial timed delays to the execution of E2E tests, but predicate-based satisfying conditions can be useful (e.g. waiting for some resolved value via `wp.data.select( 'core/data' ).hasFinishedResolution`)
I'm having trouble reproducing this in the way described, running WP 5.0.3 If I revert the changes to However, I'm seeing that when Astra is active, any post I load is immediately has the update button active and you can update the post, even when it has no embed blocks, but this doesn't happen in twentynineteen. Strangely though, Astra: Twentynineteen: |
Oops, I think I meant to recommend a different theme since I had found that Astra has a few meta boxes which make the saving work differently. I think I was going to recommend "Storefront" instead, or really any super-barebones theme which isn't enhanced for Gutenberg or which includes their own legacy meta boxes in the editor. I'll have to check on the end-to-end tests though, as there's something clearly problematic there if they still pass on master. |
@aduth I'm getting a deprecation warning and a validation error when trying to run the
Also, the |
@rodrigoi Thanks for the follow-up. I expect some of the warnings you see could be resolved by a fresh I'm not too sure about the failures you're seeing on master. Presumably it must be something in your environment, if they're passing on Travis? Could be similar to what's being considered with macOS incompatibilities improved in #14243 . That said, this branch still needs a refresh from me. If I recall correctly, the implementation itself is pretty complete, but per #13706 (comment) I needed to check if the E2E test was durable enough to actually capture the issue (it was noted that it passes on master as well, which is not expected). |
This pull request seeks to resolve an issue where embed blocks apply changes immediately upon page load, prompting a user when attempting to navigate away. This only affects themes which do not opt in to support for responsive embeds.
Implementation notes:
The root cause is that the embed block assigns a different, new value for the
className
attribute. There is no default value for theclassName
attribute, which is reasonable in that we don't want to be assigning an emptyclass=""
in markup. However, the internal logic of the embed block in producing class names viagetClassNames
will wrongly produce a different value (""
) when no changes are necessary (if the class name had beenundefined
).Testing instructions:
These instructions can be repeated on the master branch serving as "Steps to Reproduce" the original issue.
Ensure unit tests pass:
Ensure end-to-end tests pass: