Focusable Text

Link to Focusable Text copied to clipboard

WCAG 2.0 - 1.3.2 A Impact - Critical

Focusable Text identifies text elements and ensures they are available to VoiceOver.

Impact

People using VoiceOver with blindness or low-vision are most impacted. Text elements should be focusable so a screen reader can relay information to the end-user.

Confirmation

  1. Turn on VoiceOver
  2. Attempt to focus on the text element
  3. One of the following will occur:
    • Inaccessible: Text element will not be focusable.
    • Accessible: Text element is focused by VoiceOver.

How to Fix

An issue found by this rule is caused by a text element not being marked as an accessibility element. If there is a focusable parent view, then text does not need to be individually focusable. An example of this would be a label for a control, or a control's describing text.

UIKit

note

Requires the accessibility layer for accurate results. Learn how to load the accessibility layer here.

To fix in Storyboard:

  1. Navigate to the text element.
  2. Confirm that the Inspector Panel is visible.
  3. Select the Identity Inspector.
  4. Under "Accessibility", select the "Enabled" checkbox.

To fix in Code:

Make the text element focusable by VoiceOver:

label.isAccessibilityElement = true

SwiftUI

In SwiftUI, text elements are accessible by default. You'll want to confirm the text is meaningful and provides context. Don't turn off its accessibility by using the accessibility hidden view modifier.

React Native

Text elements are accessible by default. You'll want to confirm the text is meaningful and provides context. Don't turn off accessibility by using the accessible={false} property on the Text component directly.