I am working on a float chart with multiple clickable links inside a SVG. The plan is to hide the SVG from screen readers using <svg aria-hidden="true">
and have a description below the image <div class="sr-only">
(bootstrap 4) containing a description and the same links. While the SVG is hidden from screen readers, and the information inside .sr-only
is hidden from users with vision, the links inside .sr-only
is giving focus to the hidden links. Users with vision vil experience wrong focus order because of the hidden links.
Is there a common solution to this? Are .sr-only
for text only and no links?
For the reasons that you have well experienced yourself, it's indeed a bad idea to put links or any other focusable element inside a zone with .sr_only or aria-hidden=true.
If you do it, in both case you are putting people into troubles:
So, both .sr_only and aria-hidden=true are to be reserved to rather short non-interactive indications that are useful for particular users, while useless for other.
As a reminder, .sr_only and aria-hidden=true aren't exactly opposite of eachother. Content under .sr_only is hidden from the screen and readable by screen readers, while aria-hidden=true hides the content from screen readers and all other assistive tools. Don't forget about screen magnifiers, eye trackers, vocal control, highlighters for dys-troubles, etc.