Page MenuHomePhabricator

Label: <legend> must be a direct child of <fieldset>
Closed, ResolvedPublic2 Estimated Story Points

Description

Assistive technology does not read the legend for fieldsets, so users will not know the label or description for the group as a whole. Currently, the Label componet outputs a div that contains either a <label> or <legend> element, and the legend is not read by a screen reader when entering a fieldset via keyboard.

The Label element wraps the legend or label element in a div. This is necessary for the label, which does not contain the description text (it appears below the label in a separate element). However, for the legend, the description is included in the legend element, and this should be the root element output by Label.


Acceptance criteria

  • Label is refactored so that, when isLegend is true, the <legend> element is the root element of the component. The output for a label when isLegend is false should not change.
  • legend is read by a screen reader when entering a fieldset

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
CCiufo-WMF set the point value for this task to 2.Jul 20 2023, 8:48 PM
CCiufo-WMF moved this task from Needs Refinement to Up Next on the Design-System-Team board.

Change 941447 had a related patch set uploaded (by Anne Tomasevich; author: Anne Tomasevich):

[design/codex@main] Label: Make <legend> the root element

https://gerrit.wikimedia.org/r/941447

Change 941447 merged by jenkins-bot:

[design/codex@main] Label: Make <legend> the root element

https://gerrit.wikimedia.org/r/941447

Change 944353 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/core@master] Update Codex from v0.15.0 to v0.16.1

https://gerrit.wikimedia.org/r/944353

Change 944353 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v0.15.0 to v0.16.1

https://gerrit.wikimedia.org/r/944353

Volker_E updated the task description. (Show Details)