Opened 4 months ago
Closed 4 months ago
#63973 closed defect (bug) (fixed)
Add Media Button missing aria-haspopup and aria-controls
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.9 | Priority: | normal |
| Severity: | normal | Version: | 4.3 |
| Component: | Editor | Keywords: | has-patch commit |
| Focuses: | accessibility | Cc: |
Description
In the classic editor, above the TinyMCE editor, there is an "Add Media" button which, when clicked, triggers the media library to open in a dialog.
This is the current code for that button:
<button type="button" id="insert-media-button" class="button insert-media add_media" data-editor="content"><span class="wp-media-buttons-icon"></span> Add Media</button>
Screen reader users are not warned that triggering this button will open a modal dialog.
For WCAG conformance the following attributes need to be added to this button:
- aria-haspopup="dialog"
- aria-controls referncing the ID of the modal being opened
For additional information see:
Change History (6)
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
4 months ago
#3
@
4 months ago
- Component changed from TinyMCE to Editor
- Milestone changed from Awaiting Review to 6.9
- Version set to 4.3
This ticket was mentioned in PR #9932 on WordPress/wordpress-develop by @rishabhwp.
4 months ago
#4
- Keywords has-patch added
#5
@
4 months ago
- Keywords commit added
Tested. This has no significant potential for side-effects; the only plausible side-effect is in the case that an extender has added the id wp-media-modal somewhere in the editor admin.
There are no themes or plugins that return a positive test for that string in https://wpdirectory.net, so I think it's a safe bet that's not a significant concern.
I'm attributing this to version 4.3, when the control was changed to a button; though in practical truth I don't think that
aria-haspopupwas widely supported at the time.See #32969.