Traversal Order
The traversal order rule checks for the following:
- All app elements that can be focused on through touch exploration are accessible.
- All app elements follow a logical order that matches their visual layout
- The app elements do not create a navigation loop when using screen readers for linear navigation.
- Rule Category :
Keyboard and Focus Navigation
- WCAG 2.1 SC :
2.4.3 (A)
- WCAG 2.2 SC :
2.4.3 (A)
- Rule Severity :
Critical
- Supported Platforms :
Android
,iOS
Success Criteria
The specific criteria for success are:
- On Android and iOS, avoid creating traversal cycles that can cause screen readers to get stuck in a loop.
- On iOS, each element that a can be focused on using touch exploration should also be focusable during linear navigation when using assistive technology.
How to fix?
To prevent traversal order violations:
-
On Android:
- Ensure that the
accessibilityTraversalBefore
andaccessibilityTraversalAfter
attributes do not create traversal cycles, or navigation loops, when navigating between elements. - Ensure that the attributes specify the order of focus correctly and point to the previous or subsequent element logically.
- Make sure the traversal order matches the visual layout of the elements.
- Ensure that the
-
On iOS:
- Review the
accessibilityElements
property in UIKit, oronChange(of:)
with@FocusState
in SwiftUI, to ensure that all the page elements are reachable when using a screen reader. - Ensure that you do not exclude elements by creating manual focus loops, or traversal loops, that direct the screen reader between the same elements in a cycle.
- Review the
Example
Consider the following example:
Error:
- The
accessibilityTraversalAfter
property for the elements creates a cycle in linear traversal. This causes one element to be unreachable. As a result, screen readers will be stuck in a traversal loop, navigating between the same elements in a circular manner and never reaching the rest of the elements.
How to fix:
- Make sure all the
accessibilityTraversalAfter
properties specify the order of focus logically by pointing to the next element that should be reached by the screen reader. - Make sure the focus order does not create traversal cycles and all elements are reachable by the screen reader. This ensures that screen readers do not miss elements or get stuck in traversal cycles.
Reference
- Learn more about Traversal Order: 2.1 - 2.4.3 (Level A) guideline
- Learn more about Traversal Order: 2.2 - 2.4.3 (Level A) guideline
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!