CheckBox Name

Link to CheckBox Name copied to clipboard

WCAG 2.0 - 1.3.1 A Impact - Serious

CheckBox Name identifies CheckBox views and ensures both a name and value are available to TalkBack.

Supported within:
XML Layouts

Impact

People using TalkBack are impacted most by accessibility issues found by this rule.

Confirmation

  1. Turn on TalkBack
  2. Attempt to focus the control
  3. One of the following will happen:
    • Inaccessible: TalkBack only announces the value and role.
    • Accessible: Both the name and value are read by TalkBack.

How to Fix

Provide an explicit name for the CheckBox control by utilizing a TextView and associating it with your CheckBox element.

warning

Text and ContentDescription cannot be used.

CheckBox checkBox = .......; // Role: CheckBox
TextView label = .......; // Role: Label
label.setLabelFor(checkBox.getId()); // Associate the Checkbox with its Name