I've created a page using Bootstrap with a standard layout of next and previous page links. On the first page, I disable the 'previous page' link as follows:
<div role="navigation">
<ul class="pager">
<li class="previous disabled" aria-disabled="true">
<a href="#">Previous page</a>
</li>
<li class="next">
<a href="search.php?page=2">Next page</a>
</li>
</ul>
</div>
It seems like screen readers (JAWS, NVDA and VoiceOver) aren't seeing the aria-disabled="true"
flag, even though the W3C WAI-ARIA spec states:
The state of being disabled applies to the current element and all focusable descendant elements of the element on which the aria-disabled attribute is applied.
If I add aria-disabled="true"
to the link:
...
<li class="previous disabled" aria-disabled="true">
<a href="#" aria-disabled="true">Previous page</a>
</li>
...
then it works as I'd hoped, with the screen reader describing the link as 'disabled'.
Am I misunderstanding the WAI-ARIA spec, or is this a 'feature' of screen reader implementation? In his comment on 'How do i tell a screen reader that a link is disabled', Bryan Garaventa mentions:
... the use of aria-disabled works best for elements that have a defined role, such as role=button.
Can aria-disabled
only be applied to focusable elements?