Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report the role of ComposeSceneAccessible on macOS as PANEL #1362

Merged
merged 1 commit into from
May 22, 2024

Conversation

m-sasha
Copy link

@m-sasha m-sasha commented May 20, 2024

Report the role of ComposeSceneAccessible (only on macOS) and the root LayoutNode as PANEL, allowing them to be ignored when accessible elements are presented to the user.

Fixes https://youtrack.jetbrains.com/issue/COMPOSE-1398/Make-ComposePanel-transparent-to-accessibility

Testing

Run the app below on macOS, turn on VoiceOver and traverse the accessible elements via VoiceOver shortcuts (ctrl-opt-right/left). The selection should move correctly inside the ComposePanel into the Compose button.

fun main() {
    SwingUtilities.invokeLater {
        val frame = JFrame()
        val panel = JPanel(GridLayout(3, 1))
        frame.contentPane.add(panel)

        panel.add(JPanel().apply {
            add(JButton("Swing Button 1"))
        })
        panel.add(ComposePanel().apply {
            setContent {
                Column {
                    Button(onClick = {}) { Text("Compose Button") }
                }
            }
        })
        panel.add(JPanel(GridLayout(2, 1)).apply {
            add(JButton("Swing Button 2"))
        })
        frame.size = Dimension(400, 500)
        frame.isVisible = true
    }
}

This could be tested by QA

Release Notes

Fixes - Desktop

  • When using ComposePanel inside a Swing application on macOS, VoiceOver will now correctly go into the ComposePanel when traversing accessible elements.

…oot `LayoutNode` as PANEL, allowing them to be ignored when accessible elements are presented to the user.
@m-sasha m-sasha requested a review from igordmn May 20, 2024 11:38
@m-sasha m-sasha merged commit 7ad119c into jb-main May 22, 2024
6 checks passed
@m-sasha m-sasha deleted the m-sasha/allow-a11y-to-ignore-root-containers branch May 22, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants