[wp-trac] [WordPress Trac] #47722: aria-current is not implemented correctly

WordPress Trac noreply at wordpress.org
Wed Jul 17 13:48:52 UTC 2019


#47722: aria-current is not implemented correctly
-------------------------------+-----------------------------
 Reporter:  epithetic          |      Owner:  (none)
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  General            |    Version:
 Severity:  normal             |   Keywords:
  Focuses:  ui, accessibility  |
-------------------------------+-----------------------------
 Hi,

 Just noticed that aria-current isn't implemented correctly in WordPress
 5.2.2 in the global navigation menu.

 **Issue description**

 aria-current="page" is incorrectly placed on the <a> in the global
 navigation.

 As aria-current="page" is an enumerated type, it's intended to indicate
 the current place in a set, so for this to happen it needs to  placed on
 the parent <li> that contains the <a> not the actual <a>.

 Code sample taken from the main navigation.

 {{{
 <li id="menu-item-100" class="menu-item menu-item-type-custom menu-item-
 object-custom current-menu-item current_page_item menu-item-home menu-
 item-100"><a href="https://foxland.fi/demo/sanse//" aria-
 current="page">Home</a></li>
 }}}

 Expected markup.

 {{{
 <li id="menu-item-100" class="menu-item menu-item-type-custom menu-item-
 object-custom current-menu-item current_page_item menu-item-home menu-
 item-100" aria-current="page"><a href="https://foxland.fi/demo/sanse//"
 >Home</a></li>
 }}}

 See [https://www.w3.org/TR/wai-aria-1.1/#aria-current]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47722>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list