Skip to content

Support displaying custom actions on semantic group containers (accessibilityContainerType) #285

@abey

Description

@abey

When a view is configured as an accessibility container using accessibilityContainerType = .semanticGroup and has accessibilityCustomActions set, the current snapshot rendering does not display the "Actions Available" indicator or list the custom actions for that container.

In VoiceOver, semantic group containers can have custom actions that users can access via the Actions rotor. When focused on any child element within the semantic group, VoiceOver announces "actions available" and allows users to swipe up/down to access the actions.

Currently:

  • Custom actions on individual accessibility elements (isAccessibilityElement = true) - Shows "Actions Available" with action list
  • Custom actions on semantic group containers (accessibilityContainerType = .semanticGroup) - Does NOT show actions

Ideally, both cases should display the "Actions Available" indicator and list the custom actions, since both are valid VoiceOver-accessible patterns.

Example Code:

// works
let imageView = UIImageView()
imageView.isAccessibilityElement = true
imageView.accessibilityCustomActions = [UIAccessibilityCustomAction(name: "foo", ...)]

// doesn't work
let containerView = UIView()
containerView.accessibilityContainerType = .semanticGroup
containerView.accessibilityCustomActions = [
    UIAccessibilityCustomAction(name: "foo", ...),
    UIAccessibilityCustomAction(name: "bar", ...),
    UIAccessibilityCustomAction(name: "baz", ...),
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions