#50516 closed defect (bug) (fixed)
Use ARIA button class on plugin and theme auto-updates action links
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.5 | Priority: | normal |
Severity: | normal | Version: | 5.5 |
Component: | Upgrade/Install | Keywords: | has-patch commit |
Focuses: | accessibility | Cc: |
Description
This ticket is a follow-up to #50512 which raises 4 independent issues related to plugin and theme auto-updates feature.
Props should go to @ryokuhi who summarized the issue.
Currently, Enable / Disable controls are links. According to the accessibility coding standards (see the third row in the table):
- the control should be a link when JavaScript is not available and a button the rest of the time.
According to the current implementation, instead:
- when JavaScript is off, the links work because they have a working href attribute;
- when JavaScript is on, the links behave like buttons, but they’re still perceived as links.
A partial solution would be to add the CSS class aria-button-if-js, that adds a role=button for these cases; this doesn't make the link-as-button work through spacebar as expected, though.
Attachments (2)
Change History (11)
This ticket was mentioned in Slack in #accessibility by audrasjb. View the logs.
5 years ago
#5
@
5 years ago
- Keywords commit added; needs-refresh removed
50516.2.diff makes all the auto-updates toggle controls be perceived and behave like buttons. Also:
wp_theme_auto_update_setting_template()
is only used for thetmpl-theme-single
JS template. This means that with JS off, this template won't be rendered. All the links with ahref
attribute for no-JS support used here are a bit pointless. These can be button elements.- Adds
keyup
andkeydown
events to make these controls behave like buttons: activated when the Spacebar is released and preventing the page from scrolling when the Spacebar is pressed. - Avoids to update the
href
attribute when the controls are buttons (which don't have ahref
). - Avods to target elements based on their type: since the markup may change at any time, it's better to not use element selectors.
- Changes a
speak
message from "Enable auto-updates" to "Auto-updates enabled". - Removes the
polite
argument from thewp.a11y.speak()
calls, aspolite
is the default value . - Minor CSS improvements.
- Minor JS coding standards.
Some testing would be nice :)
#6
@
5 years ago
- Owner set to whyisjake
- Status changed from new to accepted
Love the spacebar controls.
Partially fixes the issue by adding aria-button-if-js class to action links