Skip to content
easeweb
Search topics

Range sliders that only move by dragging

A price slider's thumbs are plain elements moved by pointer events, so they can't be focused, have no value a screen reader can read, and can't be set without a drag.

WCAG 2.2
SC 2.1.1ASC 4.1.2ASC 2.5.7AA· new in 2.2
Required by
Section 508 · EN 301 549 (EU)
Broken <span class="thumb">
The accessibility problem illustrated: Only a drag moves it.
01

The problem

People who can't drag, and screen reader users, can't set the price range or find out what it is.

02

Try it

Drag a thumb to change the price range. Then put the mouse aside and try it with Tab and the arrow keys.

The panel shows what a screen reader announces. Can you set a price without dragging, and do you hear it?

Broken Can you fix this?

Price$20 – $160

Screen reader says:

(Tab to the price filter)

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Give each end of the range a name, a value it reads out, and a way to set it with keys and with single taps.

  1. 1Each end of the range takes focus and moves with the arrow keys.
  2. 2Each end has a name and reads its value with the unit.
  3. 3Every value can be set with clicks, taps or typing, not only a drag.
Before Two thumbs moved only by dragging
<div class="price">  <span class="price-label">Price</span>  <span class="price-values">$20 – $160</span>  <div class="track">    <span class="thumb" data-thumb="min" style="left: 10%"></span>    <span class="thumb" data-thumb="max" style="left: 80%"></span>  </div></div>
After

Two native range inputs

<fieldset class="price">  <legend>Price</legend>  <label for="price-min">Minimum</label>  <input type="range" id="price-min" min="0" max="200" step="10" value="20" aria-valuetext="$20">  <output for="price-min">$20</output>  <label for="price-max">Maximum</label>  <input type="range" id="price-max" min="0" max="200" step="10" value="160" aria-valuetext="$160">  <output for="price-max">$160</output></fieldset>

Why this fix: Use native HTML first

Fixing this with an AI coding assistant? Get this guide as Markdown

04

Verify the fix

5 checks.

Test with: Keyboard, Screen reader, Mouse, Touch

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 slider component or its library changes.

Limits

This is a starting pattern, not a guarantee for every application. Screen readers differ in how they read range inputs and custom sliders: some read the value before the name, and some on iOS move a slider by swiping up and down rather than with keys. Sliders that pick a colour, set a time on a media player, or resize a panel have needs of their own and are not covered here. If your "slider" is a row of slides with arrows, see carousels that keyboard and screen reader users can't use. Test the complete filter journey 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.

Keep this fixed as your code changes.

Turn guides like this into rules your coding agents and CI follow, then have the result retested with a keyboard and screen readers.

How retests work