Skip to content

Commit 3bf51ba

Browse files
committed
a11y: improve reaction behavior on message action list.
1 parent 4ed12bb commit 3bf51ba

File tree

1 file changed

+8
-3
lines changed
  • features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist

1 file changed

+8
-3
lines changed

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import androidx.compose.ui.graphics.Color
3939
import androidx.compose.ui.platform.LocalContext
4040
import androidx.compose.ui.res.stringResource
4141
import androidx.compose.ui.semantics.clearAndSetSemantics
42-
import androidx.compose.ui.semantics.contentDescription
42+
import androidx.compose.ui.semantics.onClick
4343
import androidx.compose.ui.semantics.semantics
4444
import androidx.compose.ui.semantics.traversalIndex
4545
import androidx.compose.ui.text.style.TextAlign
@@ -438,7 +438,7 @@ private fun EmojiButton(
438438
} else {
439439
Color.Transparent
440440
}
441-
val description = if (isHighlighted) {
441+
val a11yClickLabel = if (isHighlighted) {
442442
stringResource(id = CommonStrings.a11y_remove_reaction_with, emoji)
443443
} else {
444444
stringResource(id = CommonStrings.a11y_react_with, emoji)
@@ -454,7 +454,12 @@ private fun EmojiButton(
454454
interactionSource = remember { MutableInteractionSource() }
455455
)
456456
.semantics {
457-
contentDescription = description
457+
onClick(
458+
label = a11yClickLabel,
459+
) {
460+
onClick(emoji)
461+
true
462+
}
458463
},
459464
contentAlignment = Alignment.Center
460465
) {

0 commit comments

Comments
 (0)