Skip to content
easeweb
Search topics

Colour pickers you can only drag, with no field to type

A brand colour setting's square and hue strip move only when their handles are dragged, and the chosen colour is shown as text, so nothing in the picker takes focus, says what it is set to, or lets a colour be typed.

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="hex">#366cd9</span>
The accessibility problem illustrated: Motor:Where do I type my colour?
01

The problem

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

02

Try it

Drag the handles to change the brand colour. Then click the square somewhere else, and put the mouse aside and try Tab.

The panel shows what a screen reader announces. Can you set the colour without dragging, or type #2a9d8f?

Broken Can you fix this?

BrokenA square and a hue strip that only a drag moves
Brand colour
#366cd9

Screen reader says:

(Tab through the settings)

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Give the picker a field to type the colour, and make its square and strip controls that take focus, read their values and move with keys and single clicks.

  1. 1The colour can be typed as a code, in a field with a name.
  2. 2Every part that sets the colour takes focus, reads its name and value, and moves with keys.
  3. 3Every colour can be set with clicks, taps or typing, not only a drag.
Before A square and a hue strip that only a drag moves
<div class="brand-colour">  <span class="label">Brand colour</span>  <div class="sv-area" style="background-color: hsl(220 100% 50%)">    <span class="handle" style="left: 75%; top: 15%"></span>  </div>  <div class="hue-strip">    <span class="handle" style="left: 61%"></span>  </div>  <div class="preview" aria-hidden="true" style="--brand: #366cd9">…</div>  <span class="hex">#366cd9</span></div>
After

A hex field beside the picker

<div class="brand-colour" role="group" aria-labelledby="brand-label">  <span class="label" id="brand-label">Brand colour</span>  <div class="sv-area" style="background-color: hsl(220 100% 50%)" aria-hidden="true">    <span class="handle" style="left: 75%; top: 15%"></span>  </div>  <div class="hue-strip" aria-hidden="true">    <span class="handle" style="left: 61%"></span>  </div>  <div class="preview" aria-hidden="true" style="--brand: #366cd9">…</div>  <label for="brand-hex">Hex</label>  <input type="text" id="brand-hex" value="#366cd9" maxlength="7" spellcheck="false" autocomplete="off"></div>

Fixing this with an AI coding assistant? Get this guide as Markdown, or get every guide in your coding agent.

04

Design ideas

A colour can be typed, or picked from a palette, sliders or a wheel, all without a drag.

Five ways to draw the brand colour setting. Try each with clicks only, then Tab to it and use the arrow keys or type: four can be set without a drag and tell a screen reader what they are set to, and one gives a screen reader nothing but “button”.

In the design file

  • Draw the colour’s code as a field people can type into, not as a line of text.
  • Draw the field open and closed, and open the picker where it doesn’t cover the next field.
  • Note that a click on the square, the strip or the wheel moves the handle there, as well as a drag.
  • Give every colour in a palette a name people can read, such as Ocean or Coral, and show it on screen.
  • Draw each handle as a white ring with a dark edge, and with its focus ring.

Passes

  • A hex field that opens a picker Closed, a compact field with the colour in a small square at its start. Clicked or reached with Tab, it opens a small square and hue strip under it without taking the cursor out of the field: typing still works, a click in the square or the strip sets the colour without a drag, and Escape closes it. Keyboard users set the colour by its code.
  • Brand colour
    Swatch chips with their names Each colour is a pill with a dot and its name, the edge #6b7280 at 4.83:1; the chosen one takes a 2px #1a1a1a edge and a tick. People who can’t tell Forest from Slate read the name, a screen reader hears it, and the arrow keys move between the colours.
  • Brand colour

    Three sliders that each draw their range Hue, saturation and brightness each get a track painted with the colours it runs through, and the value written at its end, “220°”, “75%”. A tap anywhere on a track sets it there, and the arrow keys step it, so no colour needs a drag.
  • Brand colour
    A colour wheel that takes a click A ring of hues with the chosen colour in the middle and its name under it. A click or tap anywhere on the ring moves the handle there, the way WCAG’s own example of a colour wheel works, and the arrow keys turn it round.

Fails

  • Brand colour
    Swatch dots with no namesWCAG 4.1.2 Five neat dots, the chosen one with a tick. Tab reaches each, but a screen reader says only “button” five times, with nothing to tell Ocean from Coral or which one is chosen, and voice control has no name to call them by.
05

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 picker 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: some read the value before the name, and on iOS they move by swiping up and down rather than with keys. The browser's own colour pickers change between versions, so check the ones your users have. A single slider for a price or a volume is covered in range sliders that only move by dragging, and gestures in general in pinch, drag and tilt gestures with no button. Whether white text stays readable on the colour someone picks is a separate check: see low-contrast text on brand colours, photos and hover states. Test the complete setting 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