On Focus
Focusing something must not change the context — no navigating away, no opening a dialog, no submitting. Focus happens by accident all the time, because tabbing through a page focuses everything on the way past.
- Principle
- Understandable
- Guideline
- 3.2
- Level
- A
- In WCAG since
- 2.0
- Number
- 3.2.1
Broken, then fixed
The same interface twice: first with the mistake, then with the smallest change that fixes it.
Tabbing onto the select navigates immediately.
A keyboard user tabbing toward the search box lands on this and is thrown to another page. They cannot get past it — every attempt to move on triggers it again.
Focus does nothing; an explicit action navigates.
Focusing shows the options. Choosing one selects it. Pressing Go acts on it. Three separate events, and only the last one is a decision.
How to test
Check your own interface against 3.2.1, one step at a time.
- Put the mouse aside, reload the page and press Tab to move through every link, button, form field and other control in turn.
- Watch what happens as each one receives focus. Nothing may submit a form, load another page, or open a new window or dialog.
- Check that focus stays where Tab put it. A script that sends focus somewhere else as soon as a control receives it fails 3.2.1.
- Note anything that appears on focus, such as a tooltip or a menu that expands. That is allowed, as long as focus, the page and the window stay the same.
- Repeat the check inside every dialog, menu and later form step that opens when you activate something.
Common questions
Is a menu that opens on focus a failure of 3.2.1?
No. A menu that expands when it receives focus changes the content, not the context. It fails only if it also moves focus or takes the reader to another page.
Does 3.2.1 apply to mouse hover?
No. Hovering does not move focus, so 3.2.1 is about keyboard focus. Content that appears on hover is covered by 1.4.13 Content on Hover or Focus.
Does opening a dialog when a field gets focus fail 3.2.1?
Yes. A dialog that opens on focus and pulls focus into it is a change of context, and a keyboard user sets it off just by tabbing past.
Try it yourself
A lab is a small working piece of interface that you change yourself. Read its steps, use the controls under it, and watch the verdict line at the bottom: it says whether the criterion passes or fails as you go. Reset puts it back.
Try it: what focus does
How to use this lab
- Goal. Tab through a checkout form without anything happening that you didn’t ask for.
- The controls. The options under “When Email gets focus” set what the Email field does when focus reaches it: Nothing, Sends the form or Opens another page. The Press Tab in the form button moves focus to the next stop in the mock form: Name, Email, then Send.
- Try this. The lab starts on Sends the form. Press Tab in the form twice and watch the form go before Email is filled in. Then choose Nothing and press Tab in the form again.
- What it means. With Nothing, 3.2.1 passes: focus only moves, and only Send sends. With Sends the form or Opens another page, 3.2.1 fails, because keyboard and screen reader users are thrown out of the form just by moving through it. The verdict line under the lab says which.
3.2.1 fails
Also in guideline 3.2
Criteria in the same guideline often fail together.
- 3.2.2, UnderstandableLevel A
On Input
Fails when: Choosing a country reloads the page mid-form.
- 3.2.3, UnderstandableLevel AA
Consistent Navigation
Fails when: The order changes from page to page.
- 3.2.4, UnderstandableLevel AA
Consistent Identification
Fails when: One action, three names.
- 3.2.6, UnderstandableNew in 2.2Level A
Consistent Help
Fails when: Help moves around.