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

Fix ComposeAccessibleComponent.getAccessibleChild #1415

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

m-sasha
Copy link

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

ComposeAccessibleComponent.getAccessibleChild was trying to incorrectly access auxiliaryChildren if controller.accessibleByNodeId returned null.

Fixes JetBrains/compose-multiplatform#4778

Testing

  1. Run the code below
  2. Turn on VoiceOver
  3. Scroll the list with the mouse wheel.
  4. Press tab.
fun main() {
    application {
        Window(
            onCloseRequest = ::exitApplication
        ) {
            LazyColumn {
                items(100) {
                    Text("Item $it")
                }
            }
        }
    }
}

Note that this doesn't reproduce in latest jb-main, probably due to focus traversal changes.

@m-sasha m-sasha requested a review from MatkovIvan June 20, 2024 12:48
Copy link
Member

@MatkovIvan MatkovIvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to see unit tests for this case to prevent regressions

@m-sasha
Copy link
Author

m-sasha commented Jun 20, 2024

I'd love to see unit tests for this case to prevent regressions

It's a silly mistake that's not likely to be repeated, and it's hard to set up a test for this. I don't think it's worth it.

@m-sasha m-sasha merged commit da16773 into jb-main Jun 21, 2024
5 of 7 checks passed
@m-sasha m-sasha deleted the m-sasha/fix-getAccessibleChild branch June 21, 2024 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accessibility. Crash on Windows when traversing elements
2 participants