Skip to content

Labelling listbox option groups #1696

@scottaohara

Description

@scottaohara

Right now if I were to tell someone how to provide a visible label for their listbox option groups, i'd have to recommend a markup pattern like:

<div role=listbox ...>
  <div role=group aria-labelledby=f>
    <div id=f aria-hidden=true>group label</div>
    <div role=option ...>...</div>
    ...
  </div>
</div>

And fine. we can get by with that. But is there any reason we could not say that caption was an allowed child of a group in this context?

<div role=listbox ...>
  <div role=group aria-labelledby=f>
    <div id=f role=caption>group label</div>
    <div role=option ...>...</div>
    ...
  </div>
</div>

In this context, the caption would only ever be accessed directly by AT if someone were to switch out of forms mode when interacting with the listbox. Arguably, we could also tell AT that in this context the caption should be ignored... though I could see good reason to not do that as well.

Also, if we re-pickup the idea of naming an ancestor from a descendant role, this could eventually turn into:

<div role=listbox ...>
  <div role=group>
    <div role=caption>group label</div>
    <div role=option ...>...</div>
    ...
  </div>
</div>

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions