[wp-trac] [WordPress Trac] #58098: Empty top-level menu item to have role=button
WordPress Trac
noreply at wordpress.org
Fri Apr 7 15:35:35 UTC 2023
#58098: Empty top-level menu item to have role=button
-------------------------+------------------------------
Reporter: robanna | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Menus | Version:
Severity: normal | Resolution:
Keywords: | Focuses: accessibility
-------------------------+------------------------------
Comment (by joedolson):
Hey, @robanna! Thanks for contributing. Can you confirm that your request
is specific to classic menus, as displayed using `wp_nav_menu()`? The
navigation block handles things differently, so we want to confirm the
context.
Historically, the WordPress navigation menu hasn't injected any behaviors
into the menu, so I'm not convinced that we want to dictate a change of
semantics on top level headings. We do want to make sure that there are
always interactive semantics, so making sure there's never a plain <a>
element with no target makes sense.
However, the role="button" is only applicable if that top level navigation
item is used as a button trigger to open the menu, which will not always
be the case - I think it's out of scope for the function to try and
observe whether there are click events attached to the menu item.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58098#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list