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

Paragraph alignment causes issues with position #6172

Closed
2 tasks
grappler opened this issue Apr 13, 2018 · 4 comments
Closed
2 tasks

Paragraph alignment causes issues with position #6172

grappler opened this issue Apr 13, 2018 · 4 comments
Labels
[Status] Needs More Info Follow-up required in order to be actionable.
Milestone

Comments

@grappler
Copy link
Member

Issue Overview

When working with paragraph alignment the paragraph are not displayed in a logical order.

Steps to Reproduce (for bugs)

  1. Add the following text to a post.
<!-- wp:paragraph {"width":"left","backgroundColor":"#f78da7"} -->
<p style="background-color:#f78da7" class="alignleft has-background">First - left</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"width":"right","backgroundColor":"#8ed1fc"} -->
<p style="background-color:#8ed1fc" class="alignright has-background">Second - right</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"backgroundColor":"#fcb900"} -->
<p style="background-color:#fcb900" class="has-background">Third - none</p>
<!-- /wp:paragraph -->

Expected Behavior

The order

Current Behavior

The text looks like the following.
image

On the frontend with Twenty Seventeen it looks like
image

Possible Solution

Perhaps add some clearing to the third paragraph.

Todos

  • Tests
  • Documentation
@danielbachhuber danielbachhuber added the [Type] Bug An existing feature does not function as intended label May 18, 2018
@danielbachhuber danielbachhuber added this to the Merge Proposal: Editor milestone May 18, 2018
@danielbachhuber
Copy link
Member

Related #6634 #4127 #4010 #5885

@designsimply
Copy link
Member

This issue report may be out of date. I tried the following steps:

  1. Start a new post with Gutenberg.
  2. Go to More > Code Editor in the main editor toolbar.
  3. Paste the code example provided.
  4. Go to More > Visual Editor.

Result: I can only see the "Third - none" paragraph (the other two are there but hidden underneath).

screen shot 2018-07-16 at mon jul 16 6 25 44 pm
Seen at http://alittletestblog.com/wp-admin/post.php?post=13986&action=edit running WordPress 4.9.7 and Gutenberg 3.2.0 using Firefox 61.0.1 on macOS 10.13.5.

If I instead try to recreate the paragraphs and alignments manually using the Gutenberg UI instead of copying the code example directly, I end up with something that looks more like this:

screen shot 2018-07-16 at mon jul 16 6 24 32 pm
Seen at http://alittletestblog.com/wp-admin/post.php?post=13986&action=edit running WordPress 4.9.7 and Gutenberg 3.2.0 using Firefox 61.0.1 on macOS 10.13.5.

and the underlying code looks different:

<!-- wp:paragraph {"align":"left","backgroundColor":"pale-pink"} -->
<p style="text-align:left" class="has-background has-pale-pink-background-color">First</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"right","backgroundColor":"pale-cyan-blue"} -->
<p style="text-align:right" class="has-background has-pale-cyan-blue-background-color">Second</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"backgroundColor":"luminous-vivid-amber"} -->
<p class="has-background has-luminous-vivid-amber-background-color">Third</p>
<!-- /wp:paragraph -->

@grappler may I ask exactly how you arrived at the code from step one in your example? Did you get to that by using the UI or did you manually create that code example? Note: I believe the alignment implementation has changed since this issue was created.

@designsimply designsimply added [Status] Needs More Info Follow-up required in order to be actionable. and removed [Type] Bug An existing feature does not function as intended labels Jul 17, 2018
@ZebulanStanphill
Copy link
Member

@grappler @designsimply You used to be able to set the block alignment of a Paragraph to float left or right, but that was removed at some point. So can this issue be closed now because it is obsolete?

@mtias
Copy link
Member

mtias commented Jul 19, 2018

Let's close this as it's not relevant to paragraphs anymore.

@mtias mtias closed this as completed Jul 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs More Info Follow-up required in order to be actionable.
Projects
None yet
Development

No branches or pull requests

5 participants