equal-access icon indicating copy to clipboard operation
equal-access copied to clipboard

[Rules] Allow new window links to be satisfied by aria-describedby

Open jsunsawyer opened this issue 4 years ago • 2 comments

Summary

I'm using the Chrome extension, and just implemented what I had hoped to be a fine solution for the following recommendation: Users should be warned in advance if their input action will open a new window or otherwise change their context.

My implementation consists of the following markup:

<a aria-describedby="a11y-new-window" rel="noreferrer noopener" target="_blank" href=""></a>

Which maps to some accessible text globally.

<div hidden>
  <span id="a11y-new-window">Opens in a new window</span>
</div>

Justification

If this method is acceptable, it'd help me knock out other important issues, without being distracted by issues that have been resolved.

jsunsawyer avatar Nov 13 '21 01:11 jsunsawyer

This rule is prompted by this technique: https://www.w3.org/WAI/WCAG21/Techniques/general/G201 It's not tied to success criteria, so it's triggered as a recommendation, and not strictly required. Your proposal seems reasonable. I'll leave this issue open as a prompt for us to change WCAG20_A_TargetAndText to also look at the aria-describedby.

tombrunet avatar Nov 18 '21 19:11 tombrunet

Testcase: https://codesandbox.io/s/issue-545-gno8z?file=/index.html

tombrunet avatar Dec 16 '21 19:12 tombrunet