Nested Active Controls
An accessibility element should not have multiple active controls embedded within it.
People using VoiceOver are most impacted. VoiceOver can not activate more than one active control within another accessibility element.
- Turn on VoiceOver
- Attempt to focus the control
- Attempt to activate the control
- One of the following will happen:
- Inaccessible: A different control is activated.
- Inaccessible: The control is activated, but its focus box contains another control.
- Inaccessible: Nothing happens.
- Accessible: The control is activated and is the only control in its focus box.
How to Fix
Requires the accessibility layer for accurate results. Learn how to load the accessibility layer here.
An issue found by this rule is caused by incorrectly marking a parent view as an accessibility element.
- Navigate to the active control
- Select its parent view
- Confirm that the Inspectors Panel is visible
- Select the Identity Inspector
- Under "Accessibility", verify that "Enabled" is unselected
Repeat steps 3-5 with any view containing multiple active controls.
Ensure that any view containing multiple active controls are not accessibility elements:
view.isAccessibilityElement = false
This type of accessibility issue can no longer occur within SwiftUI views.