Skip to content

Alignment: the editor and the saved markup can disagree about a block's width - #84149

Open
rohitmathur-7 wants to merge 1 commit into
WordPress:trunkfrom
rohitmathur-7:fix/alignment-issue-editor-saved-markup
Open

rohitmathur-7 wants to merge 1 commit into
WordPress:trunkfrom
rohitmathur-7:fix/alignment-issue-editor-saved-markup

Conversation

@rohitmathur-7

Copy link
Copy Markdown
Contributor

What?

Closes #82679

Why?

The editor and the saved markup can disagree about a block's width

How?

When a block's saved alignment is one the parent layout withholds, the alignment control now stays visible instead of hiding. It shows that alignment as "Not applied here" and offers None to remove it. Saved markup is unchanged, so the alignment still applies if the block moves somewhere that supports it.

Testing Instructions

  • Activate a block theme that sets a wide size, such as Twenty Twenty-Five.

  • Create a new post, open the Code editor and paste:

I am set to full width.

  • Return to the Visual editor and select the inner (yellow) Group.

  • Check that the alignment control appears in its toolbar.

  • Open the control. Expect None, Wide width marked "Not available", and Full width selected and marked "Not applied here".

  • Click None. The control disappears, and the Code editor no longer shows "align":"full" or alignfull. Undo restores it.

  • Select the outer Group and turn on "Inner blocks use content width". The yellow Group's menu now offers Wide and Full as normal, selectable options.

Screenshots or screencast

Screenshot 2026-10-07 at 12 40 05 PM

Use of AI Tools

AI assistance: Yes
Tool(s): Claude
Used for: Base code generation and testing.

Show a wide or full alignment the parent layout doesn't offer as
Not applied here, and let None remove it. Saved markup is unchanged.
@github-actions github-actions Bot added the [Package] Block editor /packages/block-editor label Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: rohitmathur-7 <rohitmathur7@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

🏷️ Labels

This pull request needs exactly one label indicating its type, and has 0.

  • Required: any label starting with [Type].
  • Found: none.

Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you.

This branch has not been deployed

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

Labels

[Package] Block editor /packages/block-editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alignment: the editor and the saved markup can disagree about a block's width

1 participant