Label In Name
People using assistive technology should have the same understanding of labels as people not using assistive technology.
Supported within:
Impact
Issues detected by this rule contribute to a confusing or conflicting experience between the announcement from TalkBack and the content available 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 widgets name.
- Accessible: Text announced by TalkBack is the same or includes the displayed widgets name.
How to Fix
Ensure the widgets contentDescription
contains the name of the view.
@Composable
fun EmailButton() {
Button(
modifier = Modifier.semantics { this.contentDescription = “Send an Email” }
onClick = { … },
) {
Text(
text = “Email”
)
}
}