Opened 7 years ago
Closed 6 years ago
#43376 closed defect (bug) (fixed)
Semantic elements for non-link links: class-wp-comments-list-table.php
Reported by: | audrasjb | Owned by: | |
---|---|---|---|
Milestone: | 5.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Comments | Keywords: | semantic-buttons has-patch |
Focuses: | accessibility, javascript | Cc: |
Description
The "Quick Edit" links in comment list should be changed to buttons (or ARIA role button
).
Related: #38677
Attachments (5)
Change History (26)
#1
@
7 years ago
- Keywords has-patch added
Hi,
I uploaded two patches:
- Version 1:
43376_aria_role.diff
addsrole="button"
attribute to the links - Version 2:
43376_button_element.diff
replacesa
tag withbutton
tag with thebutton-link
class for similar rendering
I only managed links with href="#"
attributes. The other links don't need button element because the href
is not empty.
Both of the patches are tested and seems good to me.
Cheers,
Jb
#2
@
7 years ago
- Keywords needs-refresh added
- Version trunk deleted
@audrasjb thanks for the patch. I'd tend to think the version with tbe button is preferable. Please notice the button needs a type="button"
attribute and would also benefit from an aria-expanded
attribute to communicate to assistive technologies the expanded / collapsed status of the form (actually, more the collapsed status since when it opens, focus is moved and the button disappears). This would bring it in parity with what has been done for the Posts list Quick Edit in #38677 / [42725].
#3
@
7 years ago
Great, thanks.
I've seen your final patch for #38677 and I'll send a new patch soon.
@
7 years ago
Version 2 enhancement: adds role
and aria-expanded
attribute and fires it on click/cancel
#4
@
7 years ago
- Keywords needs-refresh removed
43376_button_element.2.diff
works fine in my local install.
I tried to follow the path of #43382 for consistency @afercia.
#5
@
7 years ago
- Focuses javascript added
- Milestone changed from Awaiting Review to 5.0
- Owner set to afercia
- Status changed from new to assigned
The comments screen works in a slightly different way compared to the Posts and Terms screens. Changing the Quick Edit link to a button will change the Reply link too. That's fine because both work in the same way: they're not available when JavaScript is off and they open their own form. The JavaScript part needs to take into account both cases.
In 43376.diff :
- the Reply and Quick Edit links are now buttons
- they have an
aria-expanded
attribute, dynamically updated based on the form collapsed / expanded state - when closing the Reply or Quick Edit forms, focus is moved back to the proper button
- I've slightly refactored the JS part to use more meaningful variable names:
commentRow
andreplyRow
- removes
e.preventDefault()
which is no longer necessary, as the links are not buttons with an attributetype="button"
, i.e.: there's no default action to prevent
Tested and looks good to me. Some more testing welcome!
#9
@
7 years ago
There was already #38676 for the comments screen, not a big deal we can use this new ticket. Props to @Cheffeid for the patch on the old ticket.
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
7 years ago
#14
@
6 years ago
- Keywords has-patch removed
- Milestone changed from 5.0 to 5.0.1
- Resolution fixed deleted
- Status changed from closed to reopened
Version 1: add button aria role to links with "#" anchor.