Inactive Accessible View

Link to Inactive Accessible View copied to clipboard
note

This is an experimental rule, and therefore its result(s) are considered to be in beta testing. Learn more about experimental rules and how you can help improve them.

WCAG 2.0 - 4.1.2 A Impact - Critical

Interactive views should be focusable with assistive technology.

Impact

Issues found by this rule impact anyone using assistive technology. Inability to interact with control while using assistive technology (AT) when the same control can be interacted without AT is an issue.

note

The version of Android, device, and manufacturer may play a part in issue detection.

Confirmation

  1. Turn on TalkBack or SwitchAccess
  2. One of the following will happen:
    • Inaccessible: The view is unable to be focused and or interact with.
    • Accessible: The view is focused and available to interact with.

How to Fix

XML

Avoid setting the importantForAccessibility property on tappable views with meaningful information to no. Views that people can access without assistive technology should be available for those using assistive technology.

Compose

Avoid marking tappable Compose views with meaningful information as invisibleToUser. Views that people can access without assistive technology should be available for those using assistive technology.

In both examples below, remove invisibleToUser to ensure views are available to people using assistive technology.

Button(onClick = {  },
    modifier = Modifier.semantics {
        //Remove the below API to make it accessible
        invisibleToUser()
    }
) {
    Text("Click here")
}


FloatingActionButton(onClick = {  }) {
    Image(
        painter = painterResource(id = R.drawable.floating_button),
        contentDescription = "floating button",
        Modifier.semantics { 
            //Remove the below API to make it accessible
            invisibleToUser() 
        }
    )
}