Operable · 2.5 Input Modalities

Dragging Movements WCAG 2.5.7 · Level AA

All functionality that uses dragging must also be achievable with a single pointer without dragging, such as by tapping or clicking, unless dragging is essential or the function is determined by the user agent and not modified by the author.

Level
AA
Since
WCAG 2.2
Principle
Operable
Guideline
2.5 Input Modalities

Live demo

Reorder the list without dragging

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.

Move Warm-up walk to the top of the list with single clicks or taps, without dragging. Then switch to Fails and try again.

Live example

Passes

Your workout

Arrange the steps in the order you will do them.

  1. Hill sprints, 10 minutes
  2. Warm-up walk, 5 minutes
  3. Easy jog, 15 minutes
  4. Cool-down stretch, 5 minutes

What happened

    Why it passes

    Each step has Up and Down buttons, so one click or tap moves it. People who cannot press, hold and move at once, such as head pointer or eye gaze users, can still reorder the plan. Dragging still works too.

    Why it fails

    The only way to reorder is to press, hold and drag. Someone with a tremor, or who steers the pointer by voice or eye gaze, cannot put the warm-up first.

    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 changes 5 lines

    Fails

    List that reorders only by dragging

    Live preview

    HTML
    <ol id="workout" class="sortable">  <li draggable="true">Hill sprints, 10 minutes</li>  <li draggable="true">Warm-up walk, 5 minutes</li>  <li draggable="true">Cool-down stretch, 5 minutes</li></ol>

    The script changes the order only when an item is dropped. People who cannot press, hold and move at the same time have no way to reorder the list.

    Passes

    Up and Down buttons on every item

    Live preview

    HTML
    <ol id="workout" class="sortable">  <li draggable="true">    <span id="step-1">Hill sprints, 10 minutes</span>    <button type="button" class="move-up" aria-describedby="step-1">Up</button>    <button type="button" class="move-down" aria-describedby="step-1">Down</button>  </li></ol>

    Dragging still works, but each step can also be moved one place with a single click or tap.

    Passes

    Move an item with one click

    Live preview

    JavaScript
    document.getElementById('workout').addEventListener('click', (e) => {  const btn = e.target.closest('button');  if (!btn) return;  const item = btn.closest('li');  if (btn.classList.contains('move-up') && item.previousElementSibling) {    item.previousElementSibling.before(item);  } else if (btn.classList.contains('move-down') && item.nextElementSibling) {    item.nextElementSibling.after(item);  }  btn.focus();});

    Each click moves the item one place. Moving an element in the page can drop keyboard focus, so the script puts focus back on the button that was pressed.

    Fails

    Task card that moves only by drag and drop

    Live preview

    JavaScript
    // Cards change column only when they are dragged and dropped.const board = document.getElementById('board');board.addEventListener('dragstart', (e) => {  e.dataTransfer.setData('text/plain', e.target.id);});board.querySelectorAll('.column').forEach((col) => {  col.addEventListener('dragover', (e) => e.preventDefault());  col.addEventListener('drop', (e) => {    e.preventDefault();    col.append(document.getElementById(e.dataTransfer.getData('text/plain')));  });});

    Dragging is the only way to move a task, so a person who cannot hold a button down while moving the pointer cannot update the board.

    Passes

    A Move to menu on each card

    Live preview

    HTML
    <article class="card" id="task-42">  <h3>Order more printer paper</h3>  <label for="move-42">Move to</label>  <select id="move-42">    <option>To do</option>    <option selected>Doing</option>    <option>Done</option>  </select>  <button type="button">Move</button></article>

    Choosing a column and pressing Move takes only clicks or taps, and the card can still be dragged. Keyboard support alone would not be enough.

    Why it matters

    Who it helps

    People with tremor, limited strength or dexterity, and those using head pointers, eye gaze or speech-controlled mouse emulation, often cannot press and hold while moving a pointer precisely.

    W3C: Understanding 2.5.7
    • Level AA

      Level AA is the level most laws and policies require.

    • In WCAG versions

      New in WCAG 2.2, published in October 2023.

      No WCAG 1.0 checkpoint maps to it.

    • Where it is required

      Required where the law names WCAG 2.2 or later at this level: the United Kingdom, Australia and New Zealand.

    How to test

    Checking it

    A few concrete steps. Automated tools find some failures; most need a person.

    1. Find every drag interaction, such as sortable lists, sliders, kanban boards, map panning and file drop zones.
    2. Confirm each can be done with single clicks or taps, for example move buttons, clicking a point on a slider track, or a file picker button.
    3. Keyboard support alone does not satisfy this criterion, so confirm the alternative works with a mouse or touch pointer.

    Common failures

    Where it breaks

    • A sortable list or kanban board can be reordered only by drag-and-drop.
    • A custom slider moves only when its thumb is dragged, with no way to click a point on the track or use buttons.
    • The only alternative to dragging is keyboard support, which does not help pointer users who cannot drag.