WCAG 3.2.1 On Focus — Testing Guide for Mobile & Web Apps

WCAG 3.2.1, "On Focus," is a foundational accessibility requirement. It mandates that when an interactive element receives focus, it shouldn't trigger a change of context. This ensures users can relia

June 13, 2026 · 6 min read · WCAG Guides

Ensuring Usability: A Practical Guide to WCAG 3.2.1 (On Focus)

WCAG 3.2.1, "On Focus," is a foundational accessibility requirement. It mandates that when an interactive element receives focus, it shouldn't trigger a change of context. This ensures users can reliably navigate and interact with web content and applications.

What WCAG 3.2.1 Actually Means

In simpler terms, if a user tabs to a button, clicks on a link, or navigates to an input field using a keyboard or assistive technology, that action should *only* move the focus. It should not simultaneously:

The goal is predictable interaction. Users should know what to expect when they interact with an element, and unexpected context changes can be disorienting and exclusionary.

Why "On Focus" Matters: The User Impact

This criterion directly impacts users who rely on keyboard navigation or screen readers. Imagine a user who can only navigate with the Tab key. If tabbing to a seemingly innocuous link or button suddenly navigates them away from their current position without warning, they can easily become lost, frustrated, and unable to complete their tasks.

Both the EU's European Accessibility Act (EAA) and the Americans with Disabilities Act (ADA) in the US implicitly or explicitly support the principles behind WCAG 3.2.1, aiming for digital experiences that are accessible to all users, regardless of their abilities.

Common Violations and Real-World Examples

Violations of WCAG 3.2.1 often stem from using JavaScript event handlers that combine focus events with actions that change context.

#### Web Application Examples:

  1. Link that Navigates on Hover/Focus:
  1. Form Input with Auto-Submit:
  1. Button that Opens a Modal on Focus:

#### Mobile Application Examples (Android/iOS):

  1. Tab Bar Item with Instant Navigation:
  1. Toggle Switch that Saves on Focus Change:
  1. List Item with Context Change on Focus:

Testing for WCAG 3.2.1 Compliance

Ensuring compliance requires a combination of manual exploration and automated checks.

#### Manual Testing Steps:

  1. Keyboard Navigation:
  1. Assistive Technology Simulation:
  1. Mouse Interaction (Less Direct, but Useful):

#### Automated Tools for WCAG 3.2.1 Checks:

#### Mobile-Specific Considerations (Android/iOS):

Fixing WCAG 3.2.1 Violations

The core principle for fixing 3.2.1 violations is separation of concerns: focus management should be distinct from action execution.

#### Code Examples:

Web (JavaScript):


    // This link navigates when it gains focus
    const problematicLink = document.getElementById('auto-nav-link');
    problematicLink.addEventListener('focus', () => {
        window.location.href = '/new-page'; // BAD: Context change on focus
    });

    const correctLink = document.getElementById('correct-nav-link');
    // Only navigate on a click or Enter/Space press when focused
    correctLink.addEventListener('click', (event) => {
        event.preventDefault(); // Prevent default link behavior if needed
        window.location.href = '/new-page'; // Action triggered by explicit interaction
    });

    // Ensure Enter/Space also triggers the action for keyboard users
    correctLink.addEventListener('keydown', (event) => {
        if (event.key === 'Enter' || event.key === ' ') {
            event.preventDefault();
            window.location.href = '/new-page';
        }
    });

Mobile (Conceptual - Android XML/Kotlin):

How SUSA Checks for WCAG 3.2.1 Compliance

SUSA (SUSATest) autonomously explores your application, simulating various user behaviors to uncover issues like WCAG 3.2.1 violations.

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free