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

Latest Posts block “align center” has no effect in admin #12306

Closed
nickcernis opened this Issue Nov 26, 2018 · 2 comments

Comments

Projects
None yet
5 participants
@nickcernis
Copy link
Contributor

nickcernis commented Nov 26, 2018

Describe the bug
Clicking the “align center” button on the Latest Posts block does not add the data-align="center" attribute to the wp-block div.

  • Gutenberg 4.5.1.
  • WordPress 5.0-RC1-43944 (tested with and without Gutenberg 4.5.1 active).
  • Twenty Nine 1.0 (also tested with other themes).

To reproduce

  1. Add a Latest Posts block.
  2. Click on Align Center.
  3. Inspect the wp-block div.

Expected behavior
The wp-block div includes a data-align="center" attribute.

Screenshots
align-center-latest-posts

Desktop

  • OS: macOS 10.14.1
  • Browser: Chrome 70.0.3538.102

Notes
Latests Posts content is centered on the front end; it's only the back end where no change takes effect.

@designsimply

This comment has been minimized.

Copy link
Contributor

designsimply commented Nov 27, 2018

Tested and confirmed that no alignment changes happen to the block markup in the editor when you press the "Align center" button on the Latest Posts block but that an aligncenter class is added to the <ul> container element for Latest Posts on the front end. Tested with WordPress 4.9.8 and Gutenberg ef596ca85 (>4.5.1) and the Twenty Nineteen theme using Firefox 63.0.3 on macOS 10.13.6.

@jorgefilipecosta

This comment has been minimized.

Copy link
Member

jorgefilipecosta commented Dec 3, 2018

The edit wrapper props of the block don't include the center support, they need an update.

https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/latest-posts/index.js#L31

Adding the Good first issue label.

nickcernis added a commit to nickcernis/gutenberg that referenced this issue Dec 3, 2018

Fix “align center” button to add data-align="center" in the editor
Resolves WordPress#12306, where clicking the center button on the Latest Posts
block previously had no effect on the block markup in the admin area.

@youknowriad youknowriad added this to the WordPress 5.0.3 milestone Dec 19, 2018

youknowriad added a commit that referenced this issue Dec 20, 2018

Fix “align center” button to add data-align="center" in the editor (#…
…12566)

Resolves #12306, where clicking the center button on the Latest Posts
block previously had no effect on the block markup in the admin area.

youknowriad added a commit that referenced this issue Jan 3, 2019

Fix “align center” button to add data-align="center" in the editor (#…
…12566)

Resolves #12306, where clicking the center button on the Latest Posts
block previously had no effect on the block markup in the admin area.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment