Skip to content
easeweb
Search topics

Single-page app route changes that are never announced

A single-page app's router swaps in the new view and title but leaves focus where it was, so nothing is said and the next Tab starts from the old place.

WCAG 2.2
SC 2.4.3ASC 4.1.3AA· new in 2.1
Required by
Section 508 · EN 301 549 (EU)
Broken
The accessibility problem illustrated: No vision:Did the page change?
01

The problem

Screen reader users hear nothing when a link changes the view, and keyboard users carry on from a place that no longer leads anywhere

02

Try it

Tab to a link in the shop, press Enter, and listen

Try a link in the header, then the link at the end of the list. After each, press Tab once: where does focus go next?

Broken Can you fix this?

BrokenThe router sets the title and nothing else
Teas – Harbor Tea

Teas

  • Assam, 100 g
  • Sencha, 100 g
  • Earl Grey, 100 g

Shop teaware

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

After each route change, move focus and say the new page

Before
BrokenThe router sets the title and nothing else
<body>  <nav>    <a href="/teas">Teas</a>    <a href="/teaware">Teaware</a>    <a href="/basket">Basket</a>  </nav>  <main id="view">    <h1>Teaware</h1>    …  </main></body>
What is wrong2 points

The tab title is right, but nothing else changes for the person.

  • A screen reader user hears nothing when the view changes. A screen reader does not read a title change.
  • The next Tab starts from a place unrelated to the new content. Focus stays on the link that was pressed, or falls to the document when that link went with the old view.
After

Focus the new view's heading

<body>  <nav>    <a href="/teas">Teas</a>    <a href="/teaware">Teaware</a>    <a href="/basket">Basket</a>  </nav>  <main id="view">    <h1 tabindex="-1">Teaware</h1>    …  </main></body>
How it is fixed3 steps
  1. Give the new view's h1 tabindex="-1", which lets the script focus it without adding it to the Tab order.
  2. After each route change, wait for the view to render, then move focus to its heading. The screen reader reads it as it receives focus ("Teaware, heading level 1"), and the next Tab goes to the first link or button in the new view.
  3. Leave focus alone on the first load: the browser has already put it at the top of the page.

Moving focus to the heading does both jobs at once, so this fixes the Before and passes 2.4.3 and 4.1.3.

04

Verify the fix

5 checks, no mouse.

Test with: Keyboard, Screen reader, Zoom

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat when the router or the layout changes.

How screen readers handle role="status"

Limits

This is a starting pattern, not a guarantee for every application. Screen readers react differently to focus on a heading and to focus on the body, so test with the ones your users use. This guide covers views that replace the main content. Dialogs, drawers and in-page updates have their own patterns. Test the complete journey on your real routes, including deep links and slow networks.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

EaseWeb service

Fixed it? Keep it from coming back.

I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.

See the service