[wp-trac] [WordPress Trac] #47053: Accessibility: Need to set proper 'tabindex' in 'Skip To Toolbar' HTML

WordPress Trac noreply at wordpress.org
Sun Apr 28 11:24:24 UTC 2019


#47053: Accessibility: Need to set proper 'tabindex' in 'Skip To Toolbar' HTML
-----------------------------+--------------------------------
 Reporter:  jankimoradiya    |       Owner:  (none)
     Type:  defect (bug)     |      Status:  closed
 Priority:  normal           |   Milestone:
Component:  General          |     Version:
 Severity:  normal           |  Resolution:  maybelater
 Keywords:  has-screenshots  |     Focuses:  ui, accessibility
-----------------------------+--------------------------------
Changes (by afercia):

 * keywords:  needs-patch has-screenshots dev-feedback => has-screenshots
 * status:  new => closed
 * resolution:   => maybelater
 * milestone:  Awaiting Review =>


Comment:

 @jankimoradiya thanks for your report. There's a reason for this: on the
 front end, the Toolbar needs to use one of the hooks that are available in
 a theme. Traditionally, it has been hooked to `wp_footer` because this
 hook is widely used by themes. This way, the Toolbar is rendered in the
 markup at the end of the page, before the closing `</body>` tag.

 Worth noting on the front end the Toolbar markup includes the "Skip to
 toolbar" link. There's the need to make this skip link the first tabbable
 element in the page. The only way to do that is by using a `tabindex="1"`
 attribute. I'd agree it's a compromise and, as far as I can tell, is the
 only case in WordPress where a tabindex attribute has a positive value.

 The position of the Toolbar in the markup isn't ideal in the first place.
 Ideally, it should be at the top of the markup right after the start
 `<body>` tag so it would match the visual order and there wouldn't be the
 need for a Skip link.

 WordPress 5.2 is going to introduce a new `wp_body_open` hook meant to be
 used after the start `<body>` tag: this could be used to render the
 Toolbar at the top. However, there's the need to wait for all the themes
 out there to use the new hook though. I'm afraid improvements in this area
 will need to wait a while.

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


More information about the wp-trac mailing list