When any user interface component receives focus, that alone must not trigger a change of context, such as opening a new window, submitting a form, moving focus to another component, or changing content in a way that alters the meaning of the page. Revealing a submenu or tooltip on focus is allowed.
The same task, done two ways: switch between the version that passes and the one that fails, or put them side by side.Everything in the box is live, so try it with a keyboard, a pointer or a screen reader.
Press Tab to move through the form in each version. Stop on the delivery prices link without activating it.
Live example
Passesexample.com/3-2-1-on-focuslang="en"
Failsexample.com/3-2-1-on-focuslang="en"
The tools follow the version you last used.
What happened
Why it passes
You can tab past the delivery prices link and keep filling in the form. The window opens only if you choose to activate the link.
Why it fails
Just tabbing onto the link opens a window and moves your focus into it, so you are pulled out of the form without asking.
Examples
Code that fails, and the fix
Five examples, each one running: the usual ways this criterion fails, and code that passes.Listen to them, measure them, or copy the code.
01What changes2 lines
Fails
Dialog opens when a field gets focus
Live preview
JavaScript
const zip = document.querySelector("#zip");const finder = document.querySelector("#address-finder"); // a <dialog>zip.addEventListener("focus", () => { finder.showModal();});
Tabbing into the ZIP code field opens a modal dialog and moves focus into it. Focus alone has caused a change of context, which 3.2.1 does not allow.
Passes
Dialog opens only when asked
Live preview
JavaScript
const findButton = document.querySelector("#find-address");const finder = document.querySelector("#address-finder"); // a <dialog>findButton.addEventListener("click", () => { finder.showModal();});
The dialog opens only when the person presses the Find address button, so tabbing through the form never changes the context.
Fails
Focus removed as soon as it arrives
Live preview
JavaScript
const total = document.querySelector("#order-total");total.addEventListener("focus", () => { total.blur();});
Script throws focus away the moment the field receives it, so keyboard users lose their place. WCAG documents this as failure F55.
Showing a submenu when its parent link gets focus changes content, not context. Focus stays where the person put it, so this meets 3.2.1.
Why it matters
Who it helps
Keyboard and screen reader users move focus to explore a page, and people with visual or cognitive disabilities can be disoriented when something major happens just because focus arrived. Predictable focus lets them explore safely.
Required where the law names WCAG 2.0 or later at this level: the United States, Canada, the European Union, the United Kingdom, France, Germany, Italy, Spain, the Netherlands, Ireland, Norway, Switzerland, India, Japan, Australia, New Zealand and Israel.
How to test
Checking it
A few concrete steps. Automated tools find some failures; most need a person.
Tab through every interactive element, stopping on each one without activating it.
Confirm no new window opens, no form submits, the page does not navigate, and focus is not moved elsewhere.
Repeat by clicking into form fields and with a screen reader to confirm that focus alone changes nothing major.
Common failures
Where it breaks
A form submits or the page navigates as soon as a field or link receives focus.
A pop-up window or modal dialog opens automatically when a control is focused.
Script moves focus away from an element the moment it receives focus.