Moving focus must not change the page or open a window
Giving an element focus must never by itself load another page, open a new window or switch to another route. Changes like these must wait until the user activates something, for example by pressing Enter.
Readabler check
| Rule ID | rdb-focus-change |
|---|---|
| Impact | Serious |
| Success criterion | 3.2.1 On Focus · A |
| Standards | WCAG 2.0 · WCAG 2.1 · WCAG 2.2 · Section 508 · EN 301 549 |
| Needs a change in the website’s code |
Example
<nav class="account-tabs">
<a href="/account/orders" onfocus="this.click()">Orders</a>
<a href="/account/addresses" onfocus="this.click()">Addresses</a>
</nav>Tabbing onto “Orders” loads the Orders page at once. The user can never tab past it.
<nav class="account-tabs">
<a href="/account/orders">Orders</a>
<a href="/account/addresses">Addresses</a>
</nav>Tab moves past both links. A page loads only when the user presses Enter.
Why it matters
Keyboard and screen reader users move focus to explore a page: they tab through links to hear what is there before choosing. If focusing a link already follows it, exploring becomes impossible. Every Tab press throws them onto a new page, and focus usually starts again at the top. In the worst case, as in the example, they can never get past the element.
New windows opened on focus are just as disorienting. People using screen magnifiers may not notice the new window, and screen reader users suddenly hear unfamiliar content. People with cognitive disabilities can lose track of where they are and how to go back.
WCAG 3.2.1 On Focus, at Level A, requires that receiving focus never triggers a change of context.
How to fix it
Act on activation, not on focus.
Links and buttons. Remove onfocus and focusin handlers that navigate, submit or open windows. Let the default click behaviour do the work:
<a href="/account/orders">Orders</a>
Tabs that load content. Automatically showing a tab panel when the tab receives focus is fine, as long as the content changes in place on the same page. Do not change the address or load a new document.
Dropdown navigation. A <select> that jumps to a page as soon as the user moves through the options fails for keyboard users. Add a button:
<label for="store">Choose a store</label>
<select id="store">...</select>
<button type="submit">Go</button>
Pop-ups and new windows. Open them only from a click or Enter, and tell users in the link text that a new window will open.
Focus moves. Do not move focus to another element just because something received focus, for example jumping from the first field to a promotion box.
Checklist
- Remove onfocus handlers that navigate or open windows.
- Trigger navigation only on click or Enter.
- Add a Go button to navigation dropdowns.
- Keep auto-activating tabs on the same page.
How the check works
The check presses Tab through the page in a real browser and watches what each press causes. It reports the element that just received focus when focus opened a new window or pop-up, loaded another document, or moved a single-page app to another address. Changes to the #hash on the same address are ignored. The walk stops at the first change. Changes on blur, or focus moved elsewhere by a script, need a manual check.
Resources
Updated October 27, 2026