Skip to content

Conversation

@m-sasha
Copy link

@m-sasha m-sasha commented Nov 18, 2025

To allow specifying AccessibleRoles with no corresponding Compose role, add SemanticsPropertyReceiver.awtRole.

Fixes https://youtrack.jetbrains.com/issue/CMP-9296/Support-specifying-AWT-AccessibleRole-in-semantics

Testing

Added a unit test, and tested manually with

@OptIn(ExperimentalComposeUiApi::class)
fun main() = singleWindowApplication {
    Box(
        modifier = Modifier
            .padding(16.dp)
            .clip(RoundedCornerShape(10.dp))
            .background(Color.Blue)
            .semantics(mergeDescendants = true) {
                awtRole = AccessibleRole.PUSH_BUTTON
            }
            .clickable {
                println("Clicked!")
            }
            .padding(horizontal = 16.dp, vertical = 8.dp),
        contentAlignment = Alignment.Center
    ) {
        Text("Click me", color = Color.White)
    }
}

This should be tested by QA

Release Notes

Features - Desktop

  • Allow specifying AWT AccessibleRole directly via SemanticsPropertyReceiver.awtRole.

@m-sasha m-sasha requested a review from igordmn November 18, 2025 13:18
@MatkovIvan MatkovIvan changed the title Allow specifying AWT AccessibleRole directly. Allow specifying AWT AccessibleRole directly Nov 18, 2025
Copy link
Collaborator

@igordmn igordmn left a comment

Choose a reason for hiding this comment

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

LGTM, but we need to wait for 1.10 branch.

Also needs 2 approvals.

@m-sasha m-sasha merged commit d7a4c15 into jb-main Nov 24, 2025
16 checks passed
@m-sasha m-sasha deleted the m-sasha/support-awt-role branch November 24, 2025 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants