Skip to content
easeweb
Search topics

Resizable panels you can only resize by dragging

The divider between a sidebar and the main panel moves only by dragging, so it takes no focus, says no width, and no key or click changes the width.

WCAG 2.2
SC 2.1.1ASC 2.5.7AA· new in 2.2SC 4.1.2A
Required by
Section 508 · EN 301 549 (EU)
Broken <div class="divider"></div>
The accessibility problem illustrated: Motor:How do I make the sidebar wider?
01

The problem

People who can't drag can't make the sidebar wider or narrower, and screen reader users aren't told it can be resized or how wide it is.

02

Try it

Make the sidebar wider with the mouse, then put the mouse aside and try again with Tab.

  • Broken 1: drag the line between the panes. Then press Tab: focus goes from the last note to Share, never to the divider, and the panel below never mentions it.

  • Broken 2: the same divider, with role="separator" added. Tab still passes it, and the arrow keys do nothing. A screen reader reading down the page finds at most a separator line, with no width and nothing to change.

  • Apply a fix. Try it with Tab and the arrow keys, Home and End, then with single clicks only. Can you set the width without dragging?

Broken Can you fix this?

Packing list

  • Passport and tickets
  • Charger and adapter
  • Rain jacket

Screen reader says:

(Tab through the app)

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Let people change the panel width without dragging.

Before

A divider that only a drag moves

<div class="notes-app">  <nav class="sidebar" id="sidebar" aria-labelledby="notes-title" style="width: 30%">    <h2 id="notes-title">Notes</h2>    <ul>      <li>        <a href="/notes/packing-list" aria-current="page">Packing list</a>      </li>      …    </ul>  </nav>  <div class="divider"></div>  <main class="note">    <h1>Packing list</h1>    <button type="button">Share</button>    …  </main></div>
What is wrong3 points
  • The divider can't take focus, so the keyboard never reaches it.
  • A drag is the only way to move it.
  • It has no role or value, so assistive technology isn't told there is a control here, or how wide the sidebar is.
After

A splitter that takes the arrow keys, with Narrower and Wider buttons

<div class="notes-app">  <nav class="sidebar" id="sidebar" aria-labelledby="notes-title" style="width: 30%">    <h2 id="notes-title">Notes</h2>    <ul>      <li>        <a href="/notes/packing-list" aria-current="page">Packing list</a>      </li>      …    </ul>    <div class="sidebar-width" role="group" aria-label="Sidebar width">      <button type="button" data-step="-5">Narrower</button>      <button type="button" data-step="5">Wider</button>    </div>  </nav>  <div class="divider" role="separator" tabindex="0" aria-orientation="vertical"    aria-labelledby="notes-title" aria-controls="sidebar"    aria-valuenow="30" aria-valuemin="20" aria-valuemax="50" aria-valuetext="30%"></div>  <main class="note">    <h1>Packing list</h1>    <button type="button">Share</button>    …  </main></div>
How it is fixed6 steps
  1. Put the divider in the Tab order with tabindex="0". A separator that takes focus is the focusable kind, a widget, which must have aria-valuenow.
  2. Name it after the pane it resizes, "Notes", through aria-labelledby, and point aria-controls at that pane.
  3. Give the sidebar's width as a share of the app with aria-valuenow, aria-valuemin and aria-valuemax, and say with aria-valuetext that the number is a percentage.
  4. Move it by 5% with Left and Right Arrow, and to the narrowest and widest the sidebar can be with Home and End. preventDefault() stops the arrow keys from scrolling the page too.
  5. Add Narrower and Wider buttons. They take single clicks and taps, so the width can be changed without a drag, which the splitter alone doesn't give. They are native buttons, so they are in the Tab order and voice control users can say "Click Wider". They step by the same 5% as the keys, so they reach every width the keys can.
  6. Send every way of resizing through setWidth(), so the value a screen reader reads is always the width on screen. The drag stays, as a shortcut.

This fixes both Befores and passes 2.1.1, 2.5.7 and 4.1.2. The divider now follows the window splitter pattern in the ARIA Authoring Practices Guide, apart from Enter to collapse the pane (see Implementation decisions).

04

Design ideas

A divider can stay a hairline and still change width without a drag.

Three ways to draw the line between the notes and the open note. Drag each, then try single clicks, then put the mouse aside and use Tab: two change the width with single presses, and one moves only under a held pointer.

In the design file

  • Draw the divider at rest with something to press beside it, not only a line that appears on hover.
  • Write down the narrowest and widest the sidebar can be, and the step each press makes, such as 5%.
  • Draw the divider and each button with its focus ring, at 3:1 against both panels.
  • Draw the phone layout, where the panels stack and no divider is shown.

Passes

  • Packing list
    Arrows in a pill on the line A small white pill sits on the middle of the line with a narrower and a wider arrow, each 24 by 24 pixels, so the control is where the eye already looks for it. Each press moves the line by 5%, and the line itself still takes Tab and the arrow keys and still drags. Draw the arrows dimmed at the narrowest and widest, not gone.
  • Packing list
    Sidebar sizes in the toolbar Three sizes, Narrow, Medium and Wide, in a small switch above the panels, with the current one filled in blue (6.83:1 on white), so everyone can see which size is on. The line between the panels can still be dragged to any width in between, and then none of the three is filled.

Fails

  • Packing list
    A line that appears only on hoverWCAG 2.5.7 The calmest layout: no line at all between the panels until the pointer comes close, when a 2-pixel blue line fades in to be dragged. Dragging it is the only way to change the width, so Tab finds nothing, a click does nothing, and a touch screen, which has no hover, never shows the line.
05

Verify the fix

5 checks.

Test with: Keyboard, Screen reader, Mouse, Touch, Zoom

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the layout or its panel library changes.

How screen readers handle role="separator" tabindex="0"

Limits

This is a starting pattern, not a guarantee for every application. Screen readers differ in how they read a separator and whether they pass it the arrow keys, so test the ones your users have. A single slider for a price or a volume is covered in range sliders that only move by dragging, moving cards and items in drag-and-drop boards that only a mouse can use, and gestures in general in pinch, drag and tilt gestures with no button. Resizable table columns, panels that can be docked or floated, and more than two panes in a row have needs of their own, and are not covered here. Test the complete layout with your target assistive technology.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

EaseWeb service

Fixed it? Keep it from coming back.

I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.

See the service