Skip to content

Tabs: Disable anchor support on Tab Menu Item#76442

Merged
mikachan merged 1 commit intotrunkfrom
fix/disable-anchor-tabs-menu-item
Mar 13, 2026
Merged

Tabs: Disable anchor support on Tab Menu Item#76442
mikachan merged 1 commit intotrunkfrom
fix/disable-anchor-tabs-menu-item

Conversation

@mikachan
Copy link
Copy Markdown
Member

What?

Follow-up to #75954

Disables the "HTML Anchor" field in the Advanced panel for the Tab Menu Item block to prevent users from editing or removing the auto-generated anchor value.

Why?

Editing the anchor on the Tab Menu Item block breaks the sync between the tab panel and its label. The Tab Menu Item block uses the anchor attribute (e.g., tab-1-button) to identify which tab panel it controls. This value is set automatically when the Tabs block is inserted. Because "anchor": true was set in the block's supports, an editable "HTML Anchor" field appeared in the Advanced inspector panel. Editing or clearing this value breaks the connection between the menu item and its corresponding tab panel.

How?

Removed "anchor": true from the block's supports in block.json, which removes the editable "HTML Anchor" UI control. The anchor attribute is now declared explicitly under attributes instead, so the value continues to be stored and used internally to match menu items to tab panels; it just can no longer be edited by the user.

Testing Instructions

  1. Create a new post or page
  2. Insert a Tabs block
  3. Select one of the Tab Menu Item blocks
  4. Open the Advanced panel in the block inspector on the right
  5. Confirm there is no "HTML Anchor" field present
  6. Verify the tabs still function as expected

@mikachan mikachan requested a review from scruffian March 12, 2026 12:51
@mikachan mikachan requested a review from ajitbohra as a code owner March 12, 2026 12:51
@mikachan mikachan added the [Type] Enhancement A suggestion for improvement. label Mar 12, 2026
@mikachan mikachan added the [Block] Tabs Affects the Tabs Block label Mar 12, 2026
@github-actions github-actions bot added the [Package] Block library /packages/block-library label Mar 12, 2026
@github-actions
Copy link
Copy Markdown

Flaky tests detected in 2a41d28.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23002850068
📝 Reported issues:

Copy link
Copy Markdown
Contributor

@scruffian scruffian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

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: mikachan <mikachan@git.wordpress.org>
Co-authored-by: scruffian <scruffian@git.wordpress.org>

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

@mikachan mikachan merged commit bc7e6c9 into trunk Mar 13, 2026
52 of 53 checks passed
@mikachan mikachan deleted the fix/disable-anchor-tabs-menu-item branch March 13, 2026 09:18
@github-actions github-actions bot added this to the Gutenberg 22.8 milestone Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Tabs Affects the Tabs Block [Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants