I have run into an issue with the JAWS screen reader & Firefox.
I have a tree like the one below. Whenever any of the <a>
elements gain focus, either by tabbing from the window or from the <button>
, JAWS narrates the element three times. As far as i can tell, Firefox is the only browser that does this.
Is there something wrong with my markup here?
<nav role="tree">
<ol role="group">
<li role="presentation">
<a href="javascript:void(0)" role="treeitem">Parent Link 1</a>
<ol role="group">
<li role="presentation">
<a href="javascript:void(0)" role="treeitem">Child Link 1</a>
<li role="presentation">
<a href="javascript:void(0)" role="treeitem">Child Link 2</a>
</ol>
<li role="presentation">
<a href="javascript:void(0)" role="treeitem">Parent Link 2</a>
<ol role="group">
<li role="presentation">
<a href="javascript:void(0)" role="treeitem">Child Link 3</a>
<li role="presentation">
<a href="javascript:void(0)" role="treeitem">Child Link 4</a>
</ol>
</ol>
</nav>
<button>Something else to focus on</button>
Many thanks.
Once again, i have found the answer after asking the question. :(
Evidently, if i move role="tree"
from the outer <nav>
to the first <ol>
, Firefox narrates as expected. The markup now looks like this:
<nav>
<ol role="tree">
<li role="presentation">
<a href="javascript:void(0)" role="treeitem">Parent Link 1</a>
<ol role="group">
<li role="presentation">
<a href="javascript:void(0)" role="treeitem">Child Link 1</a>
<li role="presentation">
<a href="javascript:void(0)" role="treeitem">Child Link 2</a>
</ol>
<li role="presentation">
<a href="javascript:void(0)" role="treeitem">Parent Link 2</a>
<ol role="group">
<li role="presentation">
<a href="javascript:void(0)" role="treeitem">Child Link 3</a>
<li role="presentation">
<a href="javascript:void(0)" role="treeitem">Child Link 4</a>
</ol>
</ol>
</nav>
<button>Something else to focus on</button>
This smells like a bug in Firefox to me. I have opened a bug & will follow an developments.