Skip to content

Commit c7feb74

Browse files
committed
Force adding a contentDescription to work around AccessibilityViewCheckException
``` Roborazzi: Error: [AccessibilityViewCheckResult check=AccessibilityHierarchyCheckResult ERROR SpeakableTextPresentCheck 4 [ViewHierarchyElement class=android.view.View testTag=newsResourceCard:3 bounds=Rect(1058, 2126 - 1947, 2523)] null num_answers:0 view=null] ```
1 parent d859b3c commit c7feb74

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ fun NewsResourceCardExpanded(
118118
// Pass null for action to only override the label and not the actual action.
119119
modifier = modifier
120120
.semantics {
121+
contentDescription = clickActionLabel
121122
onClick(label = clickActionLabel, action = null)
122123
}
123124
.testTag("newsResourceCard:${userNewsResource.id}"),

0 commit comments

Comments
 (0)