[wp-trac] [WordPress Trac] #38677: Semantic elements for non-link links: class-wp-posts-list-table.php

WordPress Trac noreply at wordpress.org
Tue Feb 20 18:47:53 UTC 2018


#38677: Semantic elements for non-link links: class-wp-posts-list-table.php
-------------------------------------+-------------------------------------
 Reporter:  Cheffheid                |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  5.0
Component:  Administration           |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  semantic-buttons has-    |     Focuses:  ui, accessibility,
  patch                              |  javascript
-------------------------------------+-------------------------------------

Comment (by afercia):

 We have to be very careful and distinguish the various cases. Please
 consider many of these links still work when JavaScript support is off.
 The `aria-button-if-js` CSS class with its related JS is meant for this.

 When JavaScript support is off:
 See for example the links in the Comments screen: Approve, Unapprove,
 Spam, Trash, "unspam", "untrash", and other ones: they still work and
 they're real links that trigger navigation (the page reloads). Same
 happens on other screens. In this case they should be marked up as links.

 When JavaScript support is on:
 this kind of links now behaves differently: links don't trigger navigation
 but they "do something" on the page. So when JS is on, they should be
 exposed to assistive technologies like buttons. In  this case, the
 `aria_button_if_js()` function targets the links with an `aria-button-if-
 js` CSS class and adds the aria role "button".

 Links with `hide-if-no-js` and `href="#"`
 they're visible only when JavaScript is on. They don't have a valid `href`
 value, in fact they don't trigger navigation and they "do something". In
 this case, they should be marked up as buttons. The `aria-button-if-js`
 CSS class would actually produce the same result, but it's slightly
 preferable to mark them up directly as buttons.

 @audrasjb as you mentioned, for sure there are some remaining cases to
 address on other screens, please open separate tickets for each of them :)

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


More information about the wp-trac mailing list