Tabs: Disable anchor support on Tab Menu Item#76442
Conversation
|
Flaky tests detected in 2a41d28. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23002850068
|
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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
anchoron 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": truewas 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": truefrom the block's supports in block.json, which removes the editable "HTML Anchor" UI control. Theanchorattribute 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