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

Unable to set full/wide width for a pattern #389

Closed
richtabor opened this issue Jan 6, 2022 · 7 comments · Fixed by #414
Closed

Unable to set full/wide width for a pattern #389

richtabor opened this issue Jan 6, 2022 · 7 comments · Fixed by #414
Assignees
Labels
[Component] Pattern Creator Anything related to the pattern front end editor or preview

Comments

@richtabor
Copy link
Member

Describe the bug
Within the /new-pattern/ experience, I am unable to set a pattern align attribute to wide/full. Is this intentional?

For this pattern, I believe I built it in the post.php view, and copy/pasted it in (which maintained the fullwidth value).

Screenshot
This is a test pattern

@ryelle ryelle added the [Component] Pattern Creator Anything related to the pattern front end editor or preview label Jan 6, 2022
@ryelle ryelle added this to the Pattern Creation milestone Jan 6, 2022
@StevenDufresne
Copy link
Collaborator

Just clarifying, in the new-pattern editor you are not seeing this alignment button?.. although copy and pasting seems to apply the setting properly?

@richtabor
Copy link
Member Author

I went to double-check but https://wordpress.org/patterns/new-pattern/ doesn't seem to be correct anymore — did that change?

CleanShot 2022-02-21 at 07 04 05@2x

@StevenDufresne
Copy link
Collaborator

It should be working for you now.

@richtabor
Copy link
Member Author

Thanks, that worked.

So yea, I'm not able to set blocks as wide or full in this experience — though I can paste in blocks that have the alignment already set to those (although I can't change it).

CleanShot 2022-02-22 at 09 27 53@2x

@StevenDufresne
Copy link
Collaborator

This is because the image block is the root block. If you were to wrap it in a group, your controls will appear as expected.

@ryelle Why don't we allow alignments on the root?

// At the root level of the site editor, no alignments should be allowed.

@ryelle
Copy link
Contributor

ryelle commented Feb 23, 2022

TBH, it's something we inherited from the site editor, I would need to investigate why it's needed there.

@StevenDufresne
Copy link
Collaborator

I tracked down the code and it appears it was added in 30079:

Remove the alignments from the top level of the site editor because at that point there's no defined layout, so they won't do anything.

So I think we can remove alignments: [] safely. Not sure yet if the whole Layout object can be removed yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Pattern Creator Anything related to the pattern front end editor or preview
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants