Web

JAWS Screen Reader Focus Management After Redirect

Fix JAWS screen reader reading entire page after redirect when focus is set to heading. Learn proper focus management techniques for web accessibility.

1 answer 1 view

How to fix JAWS screen reader reading entire page after redirect when focus is programmatically set to a heading?

I’m experiencing an accessibility issue where JAWS screen reader reads the entire page content after a redirect, even when focus is programmatically moved to a specific heading. This behavior differs from NVDA and VoiceOver which correctly announce only the focused heading.

Problem details:

  • User clicks a button/link on Page A
  • User is redirected to Page B
  • On Page B, focus is moved to a static heading using tabindex=“-1”
  • A widget loads asynchronously, and the heading text appears after data is available

Current behavior:

  • NVDA: Correctly announces the focused heading once content loads
  • VoiceOver: Works as expected
  • JAWS: Visual focus stays on heading but reads entire page from top

Expected behavior:
JAWS should only announce the focused heading, similar to other screen readers.

Code implementation:
Static heading:

html
<h2
  class="phw-s-match-link-text"
  tabindex="-1"
>
  Match
</h2>

Navigation button:

html
<a
  v-phw-href="'pageB'"
  aria-label="Match link"
>
  <span>
    Match link
  </span>
</a>

Focus logic:

javascript
function focusOnUploadedText() {
  const focElem = element.value.querySelector('.phw-s-match-link-text');
  setTimeout(() => {
    focElem && focElem.focus();
  }, 100);
}

What are the proper techniques to ensure JAWS respects programmatic focus changes after page redirects and only announces the focused element?

When JAWS screen reader reads the entire page content after a redirect despite programmatic focus being set to a specific heading, this is a known accessibility issue related to JAWS’s interaction behavior after page loads. To resolve this, you need to implement proper focus management techniques that account for JAWS’s specific handling of virtual cursor focus after redirects.

Contents

Understanding the JAWS Focus Issue

JAWS screen reader has unique behavior patterns when handling programmatic focus after redirects. Unlike NVDA and VoiceOver, JAWS often doesn’t announce the focused element immediately after a redirect when focus is set programmatically. Instead, it may continue reading from the top of the page or enter a different interaction mode.

According to the Accessibility Developer Guide, “When the screen reader’s cursor is on an editable element, it allows to switch to focus mode using the Enter key. When focus mode is active, a ‘beep’ sound is played. By pressing Esc, focus mode can be left (announced by a different ‘beep’ sound) and browse mode is active again.”

This behavior becomes particularly problematic with non-interactive elements like headings, especially when combined with asynchronous content loading.

Core Problem Analysis

The issue stems from JAWS handling of virtual cursor focus after page loads. As noted in the FreedomScientific standards support issue, “When navigating by content (headings, arrowing through the page, etc), the first time a user press Enter or Space while the virtual cursor is on non-interactive content after a fresh page load (but not a refresh), JAWS will move virtual cursor focus to the top of the page (rather, it loses focus and the user has to start over).”

Your implementation has several contributing factors:

  1. Setting focus to a heading with tabindex="-1"
  2. Using a redirect (not an in-page navigation)
  3. Delaying the focus setting with setTimeout
  4. The heading content loading asynchronously

Immediate Solutions

1. Use Interactive Elements Instead of Headings

Rather than using a heading with tabindex="-1", consider using a button or link that maintains keyboard accessibility:

html
<button
  class="phw-s-match-link-text"
  aria-label="Match"
  onclick="handleMatchClick()"
>
  Match
</button>

This approach works better with JAWS’s focus mode, as mentioned in the Tink.uk guide: “JAWS will automatically enter/exit forms mode whichever method is used to move focus to the field.”

2. Implement Proper Focus Timing

Remove the setTimeout delay and set focus immediately after the redirect:

javascript
function focusOnUploadedText() {
  const focElem = element.value.querySelector('.phw-s-match-link-text');
  focElem && focElem.focus();
}

3. Add Screen Reader Announcements

Include ARIA live regions to provide context to JAWS:

html
<div aria-live="polite" class="sr-only" id="focus-announcement">
  <!-- Content will be announced by screen readers -->
</div>

<script>
function focusOnUploadedText() {
  const focElem = element.value.querySelector('.phw-s-match-link-text');
  const announcement = document.getElementById('focus-announcement');
  
  // Set announcement content
  announcement.textContent = "Match details loaded";
  
  // Set focus
  focElem && focElem.focus();
}
</script>

Advanced Focus Management Techniques

1. Use Navigation Landmarks

Implement proper ARIA landmarks to help screen readers understand the page structure:

html
<nav aria-label="Breadcrumb">
  <!-- Breadcrumb content -->
</nav>

<main>
  <h2 id="match-heading" class="phw-s-match-link-text">Match</h2>
  <!-- Rest of content -->
</main>

According to the VA.gov team’s solution, “It appears this can be remediated by setting focus on the breadcrumb

Authors
Verified by moderation
Moderation
JAWS Screen Reader Focus Management After Redirect