| Id | UnlabeledActionsinCustomElements |
| Summary | Custom clickable elements do not expose clear descriptions of their action |
| Severity | Warning |
| Category | Assistive Technologies / Dynamic Feedback |
| Affects | Kotlin and Java files |
| Implementation |
Custom lint rule - check for usage of clickable elements
(Modifier.clickable, Button, etc.) without an
onClickLabel parameter.
|
Interactive elements created with Jetpack Compose's
Modifier.clickable lack the
onClickLabel parameter, preventing assistive technologies
from announcing the action associated with the element.
Without an onClickLabel, assistive technology users may not
know what action a clickable element will perform, making navigation and
interaction unclear for those relying on screen readers.
@Composable
fun ExampleClickableText() {
Text(
text = "Show details",
modifier = Modifier.clickable
// Missing: onClickLabel = "Show more details"
)
}