Opened 5 years ago
Closed 5 years ago
#8235 closed defect (bug) (fixed)
Accessibility: add information concerning links that open in a new tab
Reported by: | audrasjb | Owned by: | mercime |
---|---|---|---|
Milestone: | 6.0.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Settings | Keywords: | has-patch has-screenshots commit |
Cc: |
Description
Hello,
I noticed some buttons (actually they are links with a button UI) that open a new tab in BuddyPress Settings screen.
While target blank links are not recommended by accessibility guidelines (as it forces the behavior of the interface - there is no "open in the same tab" option on a target blank link), it can sometimes be understandable to have some target blank links, especially on a settings page where the user could loose their form fields informations.
If we want to keep target blank links, I'd recommend to add proper information about the behavior of the links so screen readers users (and also sighted users) could know what it's going to happen when they click on the related links.
For example, I'd recommand to replace:
<a href="…" target="_blank">View</a>
With something like:
<a href="…" target="_blank">View <span class="screen-reader-text"> (opens in a new window)</span></a>
Or even better (for sighted users):
<a href="…" target="_blank">View <span class="dashicons dashicons-external"></span> <span class="screen-reader-text"> (opens in a new window)</span></a>
(see screenshots below)
For reference:
- Make/Accessibility - Link destinations:
https://make.wordpress.org/accessibility/handbook/content/link-destinations/
- When to use and not use target blank:
Attachments (3)
Change History (12)
@
5 years ago
Setttins: add screen reader text for link that opens in a new window, and a dashicon for sighted users as well (includes small CSS changes to handle dashicons in buttons)
#1
@
5 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 6.0.0
Hi @audrasjb
I agree it would be a great improvement. @mercime could you look at it ?
#5
@
5 years ago
@audrasjb Thank you for the accessibility improvement!
Attached patch changes (opens in a new window)
to (opens in a new tab)
which is used for the WP dashboard's external links, adds aria-hidden="true"
to <span>
for dashicon addition, and applies style fix only to .settings_page_bp-page-settings .button-secondary .dashicon
Patch with dashicon-external added to the button