mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +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
|
package io.element.android.libraries.matrix.ui.components
|
||||||
|
|
||||||
import androidx.compose.foundation.clickable
|
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
|
import androidx.compose.foundation.selection.toggleable
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.Immutable
|
import androidx.compose.runtime.Immutable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
@@ -39,8 +39,8 @@ fun CheckableUserRow(
|
|||||||
Row(
|
Row(
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clickable(role = Role.Checkbox, enabled = enabled) {
|
.toggleable(value = checked, role = Role.Checkbox, enabled = enabled) {
|
||||||
onCheckedChange(!checked)
|
onCheckedChange(it)
|
||||||
},
|
},
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
@@ -65,7 +65,7 @@ fun CheckableUserRow(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Checkbox(
|
Checkbox(
|
||||||
onCheckedChange = onCheckedChange,
|
onCheckedChange = null,
|
||||||
checked = checked,
|
checked = checked,
|
||||||
enabled = enabled,
|
enabled = enabled,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user