-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Align Submenu block and Nav Link block by including description and wrapping span #67198
Align Submenu block and Nav Link block by including description and wrapping span #67198
Conversation
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. |
I understand the goal is to bring parity between the editor and the frontend but this is extra markup/classnames that we need to support in the future. Why do we need this span? Either in the frontend and the editor, or both. |
We should bring both navigation-link and submenu blocks into line with each other. That means:
|
@MaggieCabrera As I understand it, I think the gutenberg/packages/block-library/src/navigation-link/index.php Lines 255 to 259 in 7143076
We don't support this on the submenu, which is likely because submenu came after Navigation Link and the two blocks have fallen out of sync as they rely on a lot of duplication. #52505 requests that description is added to the submenu block. Therefore I think we should consider pivotting this PR to add the description. At that point the span makes a lot more sense. Do you agree @MaggieCabrera? @prajapatisagar Would you be interested in adjusting this PR accordingly? |
Yes will update the PR accordingly. |
Thank you for doing the work to uncover the reasons behind the current state of the block! That makes much easier to judge what the direction should be. And what you suggest sounds reasonable to me. |
@getdave I have updated the feedback. |
Could the documentation about the class names be updated too as part of this PR? |
@carolinan I have updated the documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work here @prajapatisagar 👍
When it comes to WordPress 6.8 I suggest we include a note in the miscellaneous dev notes about these markup changes.
…rapping span (WordPress#67198) * Fix missing wp-block-navigation-item__label span * Addressed feedback * Updated README.md Co-authored-by: prajapatisagar <[email protected]> Co-authored-by: MaggieCabrera <[email protected]> Co-authored-by: getdave <[email protected]> Co-authored-by: carolinan <[email protected]>
…rapping span (#67198) * Fix missing wp-block-navigation-item__label span * Addressed feedback * Updated README.md Co-authored-by: prajapatisagar <[email protected]> Co-authored-by: MaggieCabrera <[email protected]> Co-authored-by: getdave <[email protected]> Co-authored-by: carolinan <[email protected]>
Addresses part of #57099
What?
This PR fixes the missing
<span class="wp-block-navigation-item__label">
element for navigation items with submenus.Why?
The absence of the
<span class="wp-block-navigation-item__label">
element in navigation items with submenus results in inconsistent markup, potentially impacting accessibility and styling.How?
The PR adjusts the rendering logic for navigation items with submenus to include the
<span class="wp-block-navigation-item__label">
.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast