Text Field Label in Name
Checks each TextField's label to ensure it's equal to, or part of, the name of the view.
Supported within:
Impact
Issues detected by this rule can contribute to a confusing or conflicting experience between the announcement from TalkBack and the content on the screen.
Confirmation
- Turn on TalkBack
- Attempt to focus the control
- One of the following will happen:
- Inaccessible: Text announced by TalkBack is different from the displayed widget's name.
- Accessible: Text announced by TalkBack is the same or includes the displayed widget's name.
How to Fix
Ensure TextField's name is included or equal to its label.
@Composable
fun ZipCodeInput() {
OutlinedTextField(
modifier = Modifier.semantics {
this.contentDescription = “Enter your Zip Code”
},
label = “Zip Code”
)
}