Skip to content

A scrolling box the keyboard cannot reach

a11y-scrollable-focusablemoderate
On this page

Why it matters

  • A box with its own scroll bar, such as shipping terms or a size table, hides part of its text until it is scrolled. With a mouse or a finger that is easy; with the keyboard, the box must take focus first.
  • If nothing in it can be focused, a keyboard user never reaches the hidden part. WCAG 2.2 asks that everything be operable from a keyboard (success criterion 2.1.1, level A).

Example

Wrong
<div id="terms" style="overflow-y:auto;height:80px">
Right
<div id="terms" style="overflow-y:auto;height:80px" tabindex="0" role="region" aria-label="الشحن والإرجاع">

How to fix

Let the box take focus, and name it so a screen reader says what it is:

html
<div id="terms" style="overflow-y:auto;height:80px" tabindex="0" role="region" aria-label="الشحن والإرجاع">
  • Or let the text take the space it needs, without a box of its own that scrolls.

How we detect

  1. We render the page and run axe-core 4.13.0's scrollable-region-focusable rule in each engine.
  2. It reports each element whose content overflows and scrolls, when neither it nor any element inside it can take focus.
  3. Some browsers now let the keyboard reach such boxes by themselves; others do not, so the page is judged as written.