Skip to content

Latest Comments block: Can't center align #14358

Closed

Description

@codebykat

Describe the bug
Centering this block in the editor shows correctly in the preview, but on the front-end it is still left-aligned.

Right-aligning the block in the editor does not right-align it in either the editor preview or the front-end.

This block seems to get the class aligncenter added to it regardless of the editor settings.

To Reproduce
Steps to reproduce the behavior:

  1. Add a Latest Comments block
  2. Center it and publish the post
  3. Note that it is centered in the editor, but not the front-end
  4. Right-align it and update the post
  5. Note that it appears left-aligned both in the editor and the front-end

Expected behavior
Alignment options should work and the front-end view should match the editor preview.

Screenshots
Centered in editor:
Screen Shot 2019-03-09 at 11 03 10 AM
Front-end display:
Screen Shot 2019-03-09 at 11 03 16 AM
Right-aligned in editor:
Screen Shot 2019-03-09 at 11 13 01 AM

CSS in inspector:
Screen Shot 2019-03-09 at 11 11 16 AM

Desktop (please complete the following information):

  • OS: OSX
  • Browser: Firefox

Activity

  1. added
    [Block] Latest Comments
    [Type] Bug
    on Mar 9, 2019
  2. added
    Good First Issue
    on Mar 11, 2019
  3. Jackie6 commented on Mar 29, 2019

    @Jackie6
    Contributor

    Hi @codebykat I cannot reproduce the bug. Has the bug been fixed?

  4. gziolo commented on Apr 10, 2019

    @gziolo
    Member

    Is it specific to the theme used maybe?

  5. added
    Needs Dev
    on Apr 10, 2019
  6. liloo2040 commented on Apr 24, 2019

    @liloo2040

    Hi! I think I have found why it doesn't work.

    Try to work with it your css file.

    Just write .aligncenter{ text-align: center; }
    or
    .alignright{ text-align:right;}.

    I hope it helps you!

  7. codebykat commented on Apr 26, 2019

    @codebykat
    ContributorAuthor

    This was on the Gutenberg Docker env, so it looks like the theme is Twenty Nineteen.

    Just re-tested. Right align seems to be working now, but center still fails to center:

    Screen Shot 2019-04-25 at 8 54 03 PM

    Screen Shot 2019-04-25 at 8 53 58 PM

  8. changed the title [-]Latest Comments block: Can't center or right-align[/-] [+]Latest Comments block: Can't center align[/+] on Apr 26, 2019
  9. codebykat commented on Apr 26, 2019

    @codebykat
    ContributorAuthor

    Oh, nevermind, I was just testing with the Latest Posts block (which might have a bug where it can't be aligned center)?

    Latest Comments alignment seems to work now. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueNeeds Dev[Block] Latest Comments[Type] Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions