I had a similar issue with JAWS setting the tabindex
of links to -1. This was with IE9 with JAWS 14.0
The problem ended up being caused by a setting in JAWS under "Web / HTML / PDFs" -> "Links" called "Filter Consecutive Duplicate Links". JAWS describes the feature as follows:
This option controls whether consecutive links that point to the same location, one graphical and one text, are filtered. When selected, only the text link is announced. This check box is selected by default.
For example, let's say you have a icon / text link pair that both do the same thing:
<a href="javascript:void(0)" onclick="test();">
<img src="untitled.png" title="Test" alt="Test">
</a>
<a href="javascript:void(0)" onclick="test();">TEST</a>
With the setting checked JAWS will remove the image from the tab order leaving only the text link like this:
<a tabindex="-1" href="javascript:void(0)" onclick="test();">
<img src="untitled.png" title="Test" alt="Test">
</a>
<a href="javascript:void(0)" onclick="test();">TEST</a>
From my experience and some basic tests I believe this only applies when an image link is followed by a duplicate text link and not vice versa. Also it applies to any duplicate image link following the image / text pair.
The problem I ran into was that JAWS only seemed to compare the href
attribute and did not take into account other attributes such as onclick
or onkeydown
. Pair this up with the duplicate removal applying to any image links following the initial image / text link pair and you can end up with a case where the an image link following a image/ text link pair gets when it should not. Example:
<a href="javascript:void(0)" onclick="test();">
<img src="untitled.png" title="Test" alt="Test">
</a>
<a href="javascript:void(0)" onclick="test();">TEST</a>
<a href='javascript:void(0)' onclick="dontTest();">
<img src="untitled2.png" title="Test" alt="Test">
</a>
Result:
<a tabindex="-1" href="javascript:void(0)" onclick="test();">
<img src="untitled.png" title="Test" alt="Test">
</a>
<a href="javascript:void(0)" onclick="test();">TEST</a>
<a tabindex="-1" href='javascript:void(0)' onclick="dontTest();">
<img src="untitled2.png" title="Test" alt="Test">
</a>
Note: the fact that the href
is set to javascript:void(0)
is purely coincidental. This behavior should be reproducible using any value for the href
as long as the value is the same for all the links.
Hope this helps someone.