| Id | UntraversableNestedScrollwithSwitchAccess |
| Summary | Nested scrolling views cannot be fully traversed with switch access, hiding content |
| Severity | N/A |
| Category | Assistive Technologies / Focus and Navigation |
| Affects | Resource files and Kotlin and Java files |
| Implementation | Dynamic Analysis - see if the user becomes "trapped" and cannot scroll or navigate away |
NestedScrollView components fail to respond to repeated Switch Access scroll commands, trapping users within the scrollable area after one or two scroll actions.
Creates a navigation dead-end for Switch Access users who cannot continue scrolling through content or exit the scrollable area, effectively blocking access to content and preventing task completion.
<!-- Layout with NestedScrollView that can trap Switch Access navigation -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- Scrollable area -->
<androidx.core.widget.NestedScrollView
android:id="@+id/nested_scroll"
android:layout_width="match_parent"
android:layout_height="300dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Long scrollable content..." />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<!-- Unreachable button for Switch Access users -->
<Button
android:id="@+id/action_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Important Action" />
</LinearLayout>
class ScrollTrapActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_scroll_trap)
// Problematic setup: NestedScrollView without accessibility navigation handling
val nestedScrollView = findViewById<NestedScrollView>(R.id.nested_scroll)
val actionButton = findViewById<Button>(R.id.action_button)
// Issue:
// - No accessibility delegate for NestedScrollView
// - Switch Access users may become trapped after scrolling, unable to reach actionButton
// - Missing: handling for focus movement and scroll completion for assistive technologies
// The following fixes should be considered:
// - Add an accessibility delegate to nestedScrollView to enable proper navigation
// - Ensure actionButton is reachable and focusable for accessibility services
}
}