[wp-trac] [WordPress Trac] #50702: Invalid tabindex in screen-reader-shortcut

WordPress Trac noreply at wordpress.org
Mon Jul 20 16:36:33 UTC 2020


#50702: Invalid tabindex in screen-reader-shortcut
----------------------------+------------------------------
 Reporter:  erikjandelange  |       Owner:  (none)
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Toolbar         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:  accessibility
----------------------------+------------------------------
Changes (by afercia):

 * keywords:  accessibility tabindex screen-reader =>
 * type:  defect (bug) => enhancement
 * version:  5.4.2 =>
 * component:  General => Toolbar


Comment:

 Thanks for your report @erikjandelange and welcome to Trac!

 Automated checking tools shouldn't be fully trusted. While they cover a
 wide range of issues that can be automatically detected, some issues
 always require evaluation from a human.

 In this case, the tabindex 1 is legitimate and intentional. Its goal is to
 make the "Skip to toolbar" link the first focusable thing in the page.

 This was definitely ''necessary'' when the WordPress admin bar was
 visually placed at the top but actually rendered at the bottom of the DOM.

 Since WordPress 5.4, the admin bar placement was fixed but only for themes
 that support the new hook `wp_body_open`. Old themes still render the
 admin bar in the footer hook.

 For more details, see "Accessibility: the Admin Bar is now loaded with
 wp_body_open when available" in the miscellaneous dev notes for WordPress
 5.4: https://make.wordpress.org/core/2020/02/26/miscellaneous-developer-
 focused-changes-in-wordpress-5-4/

 Related ticket: #47053

 Glad to hear you're willing to make a website 100% accessible. In this
 case, I'd say Lighthouse's take on this rule is a bit too strict. If it's
 reporting it as an error, that's a wrong take. It should be reported as a
 warning that needs manual investigation.

 On the other hand, it is worth considering to remove the tabindex
 attribute altogether but only for themes that use the new `wp_body_open`
 hook because in that case it's unnecessary. However, the tabindex
 attribute needs to stay for all the other themes.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50702#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list