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 image centering in gutenberg 8.2.0 #22693

Merged
merged 2 commits into from
May 28, 2020

Conversation

roo2
Copy link
Contributor

@roo2 roo2 commented May 28, 2020

closes #22694

Description

Currently in 8.2.0, image centering is broken, I originally found it testing for wordpress.com and can confirm it also happens in gutenberg's docker testing environment
Before:
May-28-2020 16-04-11

Automattic/wp-calypso#42637

How has this been tested?

  • Installed latest version to the local docker test environment
  • Test the other image centering modes
  • Tested with resized images
    May-28-2020 18-57-21

Technical Details

It looks like the missing piece was that the .components-resizable-box__container element no longer had display: inline-block; set on it after this change https://github.com/WordPress/gutenberg/pull/22360/files#diff-d1d037caeeea85a91038b28fa70cd435L28

Note

There is currently an issue with resizing the image and then setting it to "Wide width", if you do this, the image is not set to full screen like it should be

@@ -259,7 +259,7 @@ export function ImageEdit( {
}

function updateAlignment( nextAlign ) {
const extraUpdatedAttributes = isWideAligned
const extraUpdatedAttributes = [ 'wide', 'full' ].includes( nextAlign )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wide alignment issue was a different regression introduced here 1063573#r39498180, I pushed a fix

youknowriad referenced this pull request May 28, 2020
* Image block: use hooks

* Use data hooks

* Formatting

* Fix e2e tests

* Fix useSelect

* Clean up

* Fix select
@youknowriad youknowriad marked this pull request as ready for review May 28, 2020 09:49
@youknowriad youknowriad self-assigned this May 28, 2020
@youknowriad youknowriad added the [Type] Bug An existing feature does not function as intended label May 28, 2020
@youknowriad youknowriad added this to the Gutenberg 8.2 milestone May 28, 2020
@youknowriad youknowriad added the [Block] Image Affects the Image Block label May 28, 2020
Copy link
Contributor

@ockham ockham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well in my testing! Thanks @roo2 and @youknowriad 🙂

@youknowriad youknowriad force-pushed the fix/fix-image-center-alignment branch from b8f8fd0 to 3571ce1 Compare May 28, 2020 14:54
@youknowriad youknowriad merged commit 8e10157 into WordPress:master May 28, 2020
youknowriad added a commit that referenced this pull request May 28, 2020
Co-authored-by: Riad Benguella <benguella@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image centering and full width broken in 8.2.0
3 participants