You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
nicolasgasco
changed the title
Screen readers confused by title when several svg-jars are used in the same template
Screen reader reading the wrong title when several svg-jars are used in the same page
Nov 11, 2022
nicolasgasco
changed the title
Screen reader reading the wrong title when several svg-jars are used in the same page
Screen reader reading the wrong title when several svg-jars with same title id are used in the same page
Nov 11, 2022
nicolasgasco
changed the title
Screen reader reading the wrong title when several svg-jars with same title id are used in the same page
Screen reader reading the wrong title when several svg-jars are used in the same page
Nov 11, 2022
mrloop
added a commit
to mrloop/ember-svg-jar
that referenced
this issue
Nov 28, 2022
The current implementation uses `guidFor` this will cache ids and reuse
them if the same value is passed to `guidFor`, see
https://github.com/emberjs/ember.js/blob/4e3300bdfe75da14f9714b6b1539dbd1612c5af2/packages/%40ember/-internals/utils/lib/guid.ts#L97
The ids in a HTML document should be unique. However if a `title` or
`desc` is reused, for example you have a recurring element, then
`svg-jar` generates ids which match for the recurring element.
This commit uses the `uniqueId` function from the `unique-id` helper
to generate a unique id regardless of the `svg-jar` `title` or `desc`
matching previous `svg-jar`.
Unfortunately `uniqueId` is not exported so it is copy and pasted.
In the future it will be possible to import it, see
emberjs/ember.js#20165Fixesevoactivity#243
🐞 Bug Report
Describe the bug
When using several
svg-jar
s in the same template and when providing atitle
for a11y reasons, screen readers get confused by which title belongs to which SVG since they all have the sameid
on the<title/>
tag.Reproduce the bug
svg-jar
s in the same templatetitle
to each of themtitle
in the template.Expected behavior
svg-jar
s in the same templatetitle
to each of themtitle
value.Possible Solution
Add a random identifier to
id
of<title/>
or maybe give the possibility to provide a customid
Screenshots
Additional context
Bug observed in an Ember app.
The text was updated successfully, but these errors were encountered: