Opened 10 months ago
Last modified 7 days ago
#43376 assigned defect (bug)
Semantic elements for non-link links: class-wp-comments-list-table.php
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 5.0.3 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Comments | Keywords: | semantic-buttons |
| 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 (22)
#1
@
10 months ago
- Keywords has-patch added
Hi,
I uploaded two patches:
- Version 1:
43376_aria_role.diffaddsrole="button"attribute to the links - Version 2:
43376_button_element.diffreplacesatag withbuttontag with thebutton-linkclass 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
@
10 months 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
@
10 months ago
Great, thanks. I've seen your final patch for #38677 and I'll send a new patch soon.
@
10 months ago
Version 2 enhancement: adds role and aria-expandedattribute and fires it on click/cancel
#4
@
10 months 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
@
10 months 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-expandedattribute, 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:
commentRowandreplyRow - 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
@
10 months 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.
Version 1: add button aria role to links with "#" anchor.