WCAG 2.1 · Level A · Understandable

WCAG 3.2.1 — On Focus, explained with examples

When any component receives focus, it must not initiate a change of context. Sudden navigation, opened modals, or auto-submitted forms on focus disorient keyboard users.

Number
3.2.1
Level
A
Principle
Understandable
Guideline
3.2 Predictable

Why this criterion exists

Sudden navigation, opened modals, or auto-submitted forms on focus disorient keyboard users.

If you only remember one thing: when any component receives focus, it must not initiate a change of context. Everything else on this page is detail.

Who feels it when this fails

Accessibility criteria sometimes feel abstract until you see who pays the cost when a site ignores them. On Focus affects:

  • Keyboard users

  • Screen reader users

How sites typically fail it

These are the patterns we see week after week. None are intentional — they are accidents of how teams build interfaces under deadline. Knowing the failure modes is the fastest path to writing them out of your component library.

  • Dropdown that auto-submits on selection

  • Modal that opens when a form field receives focus

How to test for it

  • Tab through every interactive element; nothing should navigate or open without an explicit click/key.

Automated scanners catch this criterion most of the time, but never all of the time. Manual testing with the keyboard and a screen reader closes the gap.

A code fix you can copy

Trigger on user action (change, click), never on focus alone.

The problem

JavaScript
select.addEventListener('focus', () => form.submit());

The fix

JavaScript
select.addEventListener('change', () => form.submit());

Trigger on user action (change, click), never on focus alone.

Frequently asked questions

What counts as a "change of context" in 3.2.1?

A context change is a major change in the content that could disorient a user who is not expecting it: a navigation to a new page or URL, a new window or tab opening, a significant DOM mutation that reorders elements, or an auto-submitted form. Expanding a dropdown, showing a tooltip, or loading more content into a list are not context changes.

Does a mega-menu that opens on focus fail 3.2.1?

A mega-menu that expands on focus is borderline — expanding a navigation menu does change content significantly but is an expected interaction pattern. The key test: would a user in the middle of the page be disoriented if focus on the nav suddenly changed their context? If the expansion stays within the nav region and does not scroll or navigate, most evaluators consider it acceptable. Auto-navigation to a new URL on focus fails clearly.

Other Understandable criteria

Find every accessibility issue on your site in 60 seconds.

Free public scan. No card. AI-generated fixes for every issue we find.