-
Notifications
You must be signed in to change notification settings - Fork 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
Editing Toolkit: Add a workaround to prevent slider blocks breaking the editor at full width #46951
Editing Toolkit: Add a workaround to prevent slider blocks breaking the editor at full width #46951
Conversation
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
Caution: This PR affects files in the Editing Toolkit Plugin on WordPress.com D52065-code has been created so you can easily test it on your sandbox. See this FieldGuide page about developing the Editing Toolkit Plugin for more info: PCYsg-ly5-p2 |
* @return bool True if the site needs a temporary fix for the incorrect slider width. | ||
*/ | ||
function needs_slider_width_workaround() { | ||
$gutenberg_path = ABSPATH . 'wp-content/plugins/gutenberg/gutenberg.php'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably check if GUTENBERG_VERSION
is defined and read the value.
This path likely won't work well on WPCOM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did try GUTENBERG_VERSION
on my local install, and it returns undefined. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I think that constant is only generated upon Gutenberg release.
The development version instead has just a define( 'GUTENBERG_DEVELOPMENT_MODE', true );
.
I guess using both GUTENBERG_VERSION
and GUTENBERG_DEVELOPMENT_MODE
should make this safe enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested by uplodaing the built plugin to an Atomic site. With the plugin deactivated, the post carousel block is broken. When I activate the plugin, it's fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Release 2.8.3: * Editor close button should deal with situation where experimental GB feature is unavailable (#46666) * Premium Content: Remove double banners (#46659) * Premium Content: Add missing migrations for margin fix (#46924) * Editing Toolkit: Add a workaround to prevent slider blocks breaking the editor at full width (#46951) * Focused Launch: added WIP Focused Launch modal behind a flag (#46686)
Changes proposed in this Pull Request
.interface-interface-skeleton__editor
to prevent some "slider" blocks to incorrectly calculate their width to 33554400px when aligned at full width.This is a workaround derived from WordPress/gutenberg#26552, and already included in Jetpack (Automattic/jetpack#17645, to be released on 2020-01-10).
The reason to add it to the Editing Toolkit is to be able to immediately release it to Atomic sites.
Testing instructions
Note: this is already fixed on Simple sites, so please test it on Atomic or local WordPress installs with Jetpack and/or CoBlocks installed.
interface-interface-skeleton__editor
element, and make sure it hasmax-width: 100%
.Fixes p9N30q-2GL-p2