evoactivity/ember-svg-jar

Screen reader reading the wrong title when several svg-jars are used in the same page

Closed this issue ยท 1 comments

๐Ÿž Bug Report

Describe the bug

When using several svg-jars in the same template and when providing a title for a11y reasons, screen readers get confused by which title belongs to which SVG since they all have the same id on the <title/> tag.

<svg role="img" aria-labelledby="title">. 
    <title id="title">Option deactivated</title>
    <path></path>
</svg>

Reproduce the bug

  • Put several svg-jars in the same template
  • Provide a different title to each of them
  • Using a screen reader, they're all announced by the first title in the template.

Expected behavior

  • Put several svg-jars in the same template
  • Provide a different title to each of them
  • Using a screen reader, they're all announced by their own title value.

Possible Solution

Add a random identifier to id of <title/> or maybe give the possibility to provide a custom id

Screenshots

Screenshot 2022-11-11 at 08 49 57

Additional context

Bug observed in an Ember app.

@nicolasgasco I've pushed up a fix #244 can you check this works as expected