mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
+4
-4
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user