Missing attribute role=’textbox’ to identify an element that allows the input of free-form text.
Description
Rule ID: content-editable-missing-attributes
This rule verifies if elements with the attribute contenteditable have also defined the following attributes:
aria-multilinearia-labelledbyoraria-label
Context
When aria-multiline="true" is set, Assistive Technologies informs the user that the textbox supports multi-line input with the expectation that Enter or Return will create a line break rather than submitting the form.
aria-label here is recommended to specify a string to be used as the accessible label. Eventually, aria-labelledby can be used to specify the id of another element in the DOM as an element’s label.
How to fix it
The rule passes when all of the following cases are fulfilled:
- Attribute
contenteditableis defined aria-labeloraria-labelledbyis defined. Note that the rule does not validatearia-labelledbyids if the referenced elements exist.
Techniques
Not Applicable