Closed Bug 1900102 Opened 4 months ago Closed 3 months ago

Switch moz-radio markup to use input + label rather than an input wrapped in a label

Categories

(Toolkit :: UI Widgets, task)

task

Tracking

()

RESOLVED FIXED
129 Branch
Accessibility Severity s3
Tracking Status
firefox129 --- fixed

People

(Reporter: hjones, Assigned: hjones)

References

(Blocks 1 open bug)

Details

(Keywords: access, Whiteboard: [recomp])

Attachments

(1 file, 1 obsolete file)

Based on this review comment on the initial patch it sounds like this markup:

<input type="radio" name="greeting" value="Hello" id="hello" />
<label for="hello">Hello</label>

works better with certain screen readers compared with having the label wrap the input. Based on that feedback we should update the markup. There are a couple of questions we should get answered that may impact the scope of the bug and/or represent other bugs we should file:

  • Is it important to have the space between the label and the input be clickable? This was the main motivation for using the input wrapped in a label markup. There are other ways of achieving this, though they are less clean/tidy.
  • Is this an issue that needs to be addressed with our moz-toggle and moz-checkbox inputs as well, since they use similar markup?
Accessibility Severity: --- → s3
Keywords: access

This change should make it so that screen readers only announce the label once while maintaining the ability for mouse users to hover/click on the whitespace around the label text.

Assignee: nobody → hjones
Status: NEW → ASSIGNED

This revision adjusts the styling of moz-radio to avoid block, flex display
styling that can cause screen readers to perceive the button, label as "on
different lines" even though they are grouped visually. This revision maintains
the ability to click the interstice between the button and the label.

Attachment #9407060 - Attachment is obsolete: true
Attachment #9406729 - Attachment description: Bug 1900102 - switch moz-radio markup to input + label to fix a11y issue r=#recomp-reviewers,#accessibility-frontend-reviewers → WIP: Bug 1900102 - switch moz-radio markup to input + label to fix a11y issue r=#recomp-reviewers,#accessibility-frontend-reviewers
Attachment #9406729 - Attachment description: WIP: Bug 1900102 - switch moz-radio markup to input + label to fix a11y issue r=#recomp-reviewers,#accessibility-frontend-reviewers → Bug 1900102 - switch moz-radio styles to avoid flexbox to fix NVDA issue r=#recomp-reviewers,#accessibility-frontend-reviewers
See Also: → 1903407
Pushed by hjones@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2a8c683b24d6 switch moz-radio styles to avoid flexbox to fix NVDA issue r=reusable-components-reviewers,accessibility-frontend-reviewers,desktop-theme-reviewers,dao,tgiles
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: