I have a script whereby if a user is focused on an element and presses the down arrow key, it expands/collapses a section. Works in all browsers I’ve tested without a screen reader, and it works on Safari with VoiceOver on. But as soon as you turn JAWS or NVDA on it stops working. Here’s the script:
$(".axxs-accordion .a-trigger").keydown(function (event) {
if (event.keyCode === 40) {
event.preventDefault();
$(this).next(".a-section.collapsed").removeClass("collapsed").addClass("expanded");
}
});
And the HTML:
<div class="axxs-accordion">
<h2 class="a-trigger" tabindex="0">Heading</h2>
<div class="a-section collapsed">
Content here
</div>
</div>
So it seems that JAWS and NVDA hijack the arrow keys, and there is no way to free them from their prison. Any ideas?