Screen reader accessibility issue with same-page links – A quick fix
-
Hi, Steven,
First of all, thanks for this great plugin, and for sharing it under open source licence.
Here is my solution for screen readers accessibility issue with same-page links.
Problem
When we press ENTER on a link received by email, screen readers like JAWS and VoiceOver for iOS let the focus at the beginning of the content.This means that the browser start and follow the link, then that the document’s content scroll and stop right to the heading targetted by the link as expected, but that the focus don’t follow.
As a result, a seeing person can view the heading targetted by the link on the top of his browser, and is able to start reading more just by scrolling down.
But a screen reader user attempting to read next stuff will start reading the content from the beginning instead. And sure, that’s we don’t want.
Solution
Go to ‘Easy Table of Contents > includes > class.post.php’ line 1045, and then, replace these lines of code:array( '><span class="ez-toc-section" id="' . $anchor . '"></span>', '<span class="ez-toc-section-end"></span></h' . $matches[ $i ][2] . '>' ),
…by these one:
array( ' tabindex="-1" id="' . $anchor . '">', '</h' . $matches[ $i ][2] . '>' ),
Notes:
- My replacing code is W3C’s HTML specification conform.
- Successfully tested with last versions of JAWS, NVDA and VoiceOver for iOS, respectively copled with Chrome, Firefox and Safari.
Regards,
- The topic ‘Screen reader accessibility issue with same-page links – A quick fix’ is closed to new replies.