Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove aria-label from images if alt text is not present #574

Closed
swashbuck opened this issue Aug 20, 2024 · 0 comments · Fixed by #575
Closed

Remove aria-label from images if alt text is not present #574

swashbuck opened this issue Aug 20, 2024 · 0 comments · Fixed by #575
Assignees
Labels
enhancement New feature or request

Comments

@swashbuck
Copy link
Contributor

Subject of the enhancement

If alt text is not present for an image, it is hidden from screen readers with aria-hidden="true". However, the aria-label attribute is still present and serves no purpose.

I would suggest that we completely remove aria-label="" when there is no alt text.

Your environment

  • Core 6.53.6

Steps to reproduce

Add a Graphic component with an empty string for the alt text.

  {
    "_id": "c-105",
    "_parentId": "b-100",
    "_type": "component",
    "_component": "graphic",
    "_classes": "",
    "_layout": "right",
    "title": "c-105",
    "displayTitle": "",
    "body": "",
    "instruction": "",
    "_graphic": {
      "alt": "",
      "longdescription": "",
      "large": "course/en/images/single-width.png",
      "small": "course/en/images/single-width.png",
      "attribution": "",
      "_url": "https://kineo.com",
      "_target": ""
    },
    "_isScrollable": false,
    "_defaultScrollPercent": 0,
    "_isOptional": true
  },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant