Aria label overrides link text

Created on 9 December 2024, 5 months ago

I'm using this module for a11y purposes. We need a description of icons used in inline texts. This module enables us to put an aria-label on the icon.

Recently updated from 2.0.2 to 2.0.4. Now the area-label for external links is not on the icon wrapper anymore, but on the link (anchor). Screen readers will now read this label f.e. "(external link)", instead of link text.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands Drumanuel

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Drumanuel
  • πŸ‡³πŸ‡±Netherlands Drumanuel
  • πŸ‡³πŸ‡±Netherlands Drumanuel
  • First commit to issue fork.
  • @drumanuel i tried above steps , but the issue didnot reproduced at all .

  • πŸ‡³πŸ‡±Netherlands Drumanuel

    @sourabhsisodia_ I did some testing and found this:

    It only seems to happen when "Prevent text wrapping separating the last word from the icon." is disabled AND font-awesome is enabled.

    These values is extlink.settings.yml

    extlink_use_font_awesome: true
    extlink_prevent_orphan: false
    
  • Pipeline finished with Success
    5 months ago
    Total: 485s
    #369674
  • Pipeline finished with Success
    5 months ago
    Total: 537s
    #369684
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Feedback on the MR.

  • Status changed to Needs work about 24 hours ago
  • First commit to issue fork.
  • πŸ‡ΊπŸ‡ΈUnited States cboyden

    I've updated the MR to address the review in #10.

    Comparison of markup with the settings as in #7:

    Before:

    <p>Here is a mailto link: 
      <a href="mailto:me@example.com" class="mailto" data-extlink="" aria-label="(link sends email)">Email me
        <span class="fa-mailto extlink" role="img" aria-hidden="false">
          <span class="fa fa-envelope-o" data-extlink-placement="append">
          </span>
        </span>
      </a>.
    </p>
    

    After:

    <p>Here is a mailto link: 
      <a href="mailto:me@example.com" class="mailto" data-extlink="">Email me
        <span class="fa-mailto extlink" aria-label="(link sends email)" role="img" aria-hidden="false">
          <span class="fa fa-envelope-o" data-extlink-placement="append"></span>
        </span>
      </a>.
    </p>
    

    Comparison of markup with these settings:

    extlink_use_font_awesome: true
    extlink_prevent_orphan: true
    

    Before:

    <p>Here is a mailto link: 
      <a href="mailto:me@example.com" class="mailto" data-extlink="">Email 
        <span class="extlink-nobreak" aria-label="(link sends email)">me
          <span class="fa-mailto extlink" role="img" aria-hidden="false">
            <span class="fa fa-envelope-o" data-extlink-placement="append"></span>
          </span>
        </span>
      </a>.
    </p>
    
    After:
    <code>
    <p>Here is a mailto link: 
      <a href="mailto:me@example.com" class="mailto" data-extlink="">Email 
        <span class="extlink-nobreak">me
          <span class="fa-mailto extlink" aria-label="(link sends email)" role="img" aria-hidden="false">
            <span class="fa fa-envelope-o" data-extlink-placement="append"></span>
          </span>
        </span>
      </a>.
    </p>
    

    This change should also fix πŸ› Text splitting prevents screen reader from reading multiword link text Needs work and πŸ› Accessibility issue - [role="img"] elements must have an alternative text Active . It will probably also make πŸ› Fix Font Awesome markup and CSS Needs review moot.

Production build 0.71.5 2024