An element should indicate whether it should be focusable by assistive technologies or not. You can help users of assistive technologies by choosing which elements they can interact with. By keep unnecessary elements out of the accessibility tree, the user experience is improved.
Relates to 1.1.1
On Android, you can use the setImportantForAccessibility
method to set whether assistive technologies can focus on an element. You can also set this property directly in XML by using the android:importantForAccessibility
property.
view.importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_NO
<View
android:importantForAccessibility="no" />
On iOS, you can use the isAccessibilityElement
property to indicate whether assistive technologies can focus on an element.
element.isAccessibilityElement = false
On Flutter, the focusable
property of SemanticsProperties
can be used to indicate whether assistive technologies can focus on an element.
Semantics(
focusable: false,
child: Widget();
);
In React Native, the accessible
property indicates whether assistive technologies can focus on an element.
<View accessible />
In Xamarin, the IsInAccessibleTree
property indicates whether assistive technologies can focus on an element.
<Image
AutomationProperties.IsInAccessibleTree="False" />