From 26e4e895a9cd1dbfa09a75dee70b321ffc642e16 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 1 Jul 2026 17:51:12 +0200 Subject: [PATCH] Fix accessibility: announce checked/unchecked state for invite user rows (#6407) Replace clickable(role = Role.Checkbox) with toggleable(value = checked, role = Role.Checkbox) so TalkBack can announce the current state and state changes. Set the inner Checkbox.onCheckedChange = null to make it a purely visual indicator, avoiding duplicate accessibility focus on the same control. Co-Authored-By: Claude Sonnet 4.6 --- .../libraries/matrix/ui/components/CheckableUserRow.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/CheckableUserRow.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/CheckableUserRow.kt index 917b03f309f..dfcc154da47 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/CheckableUserRow.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/CheckableUserRow.kt @@ -8,12 +8,12 @@ package io.element.android.libraries.matrix.ui.components -import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.width +import androidx.compose.foundation.selection.toggleable import androidx.compose.runtime.Composable import androidx.compose.runtime.Immutable import androidx.compose.ui.Alignment @@ -39,8 +39,8 @@ fun CheckableUserRow( Row( modifier = modifier .fillMaxWidth() - .clickable(role = Role.Checkbox, enabled = enabled) { - onCheckedChange(!checked) + .toggleable(value = checked, role = Role.Checkbox, enabled = enabled) { + onCheckedChange(it) }, verticalAlignment = Alignment.CenterVertically, ) { @@ -65,7 +65,7 @@ fun CheckableUserRow( } } Checkbox( - onCheckedChange = onCheckedChange, + onCheckedChange = null, checked = checked, enabled = enabled, )