Skip to content

MacOS Adapter - Sub roles #477

Closed
@HolgerGottChristensen

Description

@HolgerGottChristensen

I have been trying to implement accessibility for some of my controls, and is currently comparing the accessiblity tree generated from my application, and from the equivalent SwiftUI application.

When implementing accessibility for checkboxes, toggle buttons and switches, i noticed the accessibility tree generated by SwiftUI uses the role CheckBox for all the three controls, but with different sub roles.

https://developer.apple.com/documentation/appkit/nsaccessibilitysubrole?language=objc

How is it intended to implement these using AccessKit? I see AccessKit specifies CheckBox and Switch as different roles, but I see no role equivalent to the toggle button.

I can also see when the Switch and CheckBox roles from AccessKit are used, they both set the NSAccessibilityRole CheckBox, but no sub role.

Toggle button from SwiftUI

Screenshot 2024-10-29 at 21 16 28

Checkbox from SwiftUI

Screenshot 2024-10-29 at 21 17 13

Toggle from SwiftUI

Screenshot 2024-10-29 at 21 18 04

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