Skip to content

[Range] What is the label? #1244

@bkardell

Description

@bkardell

Related to #1243, but potentially separate - again the example is

<rangegroup name="temperature-range" min="-100" max="100">
  <input type="range" name="temperature-range-min" min="-50" max="0" value="-25">
  <input type="range" name="temperature-range-max" min="0" max="20" value="15">
</rangegroup>

Later, it says

A can have an associated label by referencing the id and use the for attribute on the label.

So, in this example - what is the label? Also, again related to what I said in #1243 - there isn't any pre-defined relationship between the children so how would they identify to a screen reader, for example? How would you know what you're picking?

I guess these need to be direct children of rangegroup so you couldn't wrap labels on them? Would they work if you did something like:

<label id="temperature-range-min-label" class="visually-hidden">Temperature range, minimum</label>
<label id="temperature-range-max-label" class="visually-hidden">Temperature range, maxiumum</label>
<rangegroup name="temperature-range" min="-100" max="100">
  <input type="range" name="temperature-range-min" aria-labelledby="temperature-range-min-label"min="-50" max="0" value="-25">
  <input type="range" name="temperature-range-max" aria-labelledby="temperature-range-max-label" min="0" max="20" value="15">
</rangegroup>

or maybe invert it and use the label's for or maybe even just aria-label?

In any case, I'd like to understand how we believe this should work - what should/shouldn't, and ideally at least not provide only (probably) inaccessible examples. Doing the work should both help us think about it, see what it looks like (that looks pretty icky to me, for example) and then ultimately encourage something accessible.

Metadata

Metadata

Assignees

Labels

Enhanced range slidera11y-trackerGroup bringing to attention of a11y, or tracked by the a11y Group but not needing response.agenda+Use this label if you'd like the topic to be added to the meeting agenda

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions