Skip to main content
Vially Logo

WCAG 2.1 Criteria Documentation

3.2.1 – On Focus (Level A)

High-Level Description

This success criterion ensures that no unexpected changes occur when an element receives focus. Putting focus on a field or component must not trigger actions such as submitting a form, navigating to a new page, or opening a new window.

Detailed Description

Applies to:

  • Form fields, links, buttons.
  • Custom widgets, menus, and modals.
  • Interactive components with dynamic behaviours triggered on focus.

This allows:

  • Keyboard and screen reader users to safely navigate through content.
  • Users with cognitive disabilities to explore interfaces without triggering unexpected outcomes.
  • All users to remain in control of their browsing experience.

Indicators of Non-Compliance:

  • A field submits a form as soon as it receives focus.
  • Focusing on a dropdown causes a new page to load automatically.
  • A video or audio starts playing just by tabbing onto a control.
  • Page scrolls or content moves unexpectedly on focus.

Real World Examples

ScenarioNon-CompliantCompliant
Form with auto-submitTabbing into a field causes the form to submit.Form submits only on explicit user action, such as pressing the 'Enter' or Submit button.
Country selection dropdownSelecting a country immediately reloads the page.Country reloads only after user confirms by pressing a 'Submit' or 'Continue' button.
Auto-playing video on focusTabbing into video player triggers autoplay.Video starts to play only when user presses the 'play' button.

Disability Impact

Disability GroupWithout ComplianceWith Compliance
Keyboard Only UsersMay trigger unexpected navigation or form submissions.Can safely navigate using 'Tab' key.
Screen Reader UsersExperience context switches or focus loss mid-navigation.Screen reader flows consistently.
Cognitive DisabilitiesSurprises or sudden changes can increase confusion or anxiety.Predictable interactions build trust and usability.
Motor ImpairmentsAccidental triggers are harder to reverse.Interaction requires intentional input, reducing errors.

Supporting Documentation

Remediation Strategies

    Use 'onClick' or 'onKeyDown' to trigger changes instead:
    element.addEventListener('keydown', (e) => {
    if (e.key === 'Enter' || e.key === ' ') {
    openModal(); // Only triggers on user action
    }
    });

    < form >
    < input type="text" name="email" / >
    < button type="submit" >Submit< /button >
    < /form >

    If dropdowns or selections are used for navigation, include a separate action button:
    < select name="country" >
    < option value="ie" >Ireland< /option >
    < option value="uk" >UK< /option >
    < /select >
    < button type="submit" >Go< /button >

    Use Tab/Shift+Tab and arrow keys to move through the page. Confirm that nothing changes until you deliberately activate something.