Skip to main content
No Result Found

Content description in editable elements

Editable elements such as EditTexts or TextViews should not have a contentDescription property. This ensures that screen readers can accurately navigate, describe, and interact with user-entered text within these elements.

Screen readers are designed to automatically read the text entered in editable fields. Defining a contentDescription property can interfere with this functionality, preventing users from receiving essential feedback about their input.

  • Rule Category : Accessibility Labels
  • WCAG 2.1 SC : 4.1.2 (A)
  • WCAG 2.2 SC : 4.1.2 (A)
  • Rule Severity : Serious
  • Supported Platforms : Native Android apps only

Success criteria

The rule checks for the following potential violations:

  • contentDescription in editable elements
    Editable fields such as EditText or TextView should not have a contentDescription property. This property can interfere with the screen reader’s ability to read the entered text.

How to fix

To fix violations related to contentDescription property in Android, follow these steps:

  • Do not use contentDescription
    Do not set a contentDescription property on EditText or TextView.

  • Use hint for accessibility labels
    Use the hint property to define the editable element’s name and purpose.

  • Associate elements using labelFor
    Associate a label with an input field using the labelFor property. This ensures the screen reader announces the label alongside the input field.

Example

The following example scan report highlights an input field with a defined contentDescription property. This violation prevents screen readers from reading the text entered in that field.

The App Accessibility issue details window with a "Content Description in editable elements" violation highlighted by a red box.

Fix

To correct this violation:

  1. Remove the contentDescription property.
  2. Add a hint attribute to the EditText element to provide a label.
  3. Alternatively, use the labelFor property in TextView to associate a label with the input field.

References

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle