https://kotlinlang.org logo
#compose
Title
# compose
l

Laura Kelly

01/20/2022, 9:48 PM
I’m working on accessibility for a custom checkbox component, trying to get the error state to read out correctly on a screen reader. Right now when the checkbox has an error, the error message is not being read by TalkBack. The code looks something like:
Copy code
Box(
 modifier = modifier
   .triStateCheckbox(…)
   .requiredSize(…)
   .border(…)
   .background(…)
   .semantics {
     error("Error invalid input")
    }
) {
 MyIcon(
  contentDescription = null,
  modifier = Modifier.clearAndSetSemantics {}
 )
}
I set some breakpoints and
SemanticsPropertyReceiver.error
is being set correctly, but
setContentInvalid
 in 
AndroidComposeViewAccessibilityDelegateCompat
 is not. I tried removing the inner icon since it’s altering its semantics but that doesn’t seem to change anything. I’m trying to figure out if I am doing something wrong in using
.semantics
or if there might be bug here.
z

Zach Klippenstein (he/him) [MOD]

01/24/2022, 5:32 PM
That sounds like a bug to me, go ahead and file it
👀 2
👍 2
l

Laura Kelly

01/24/2022, 5:37 PM
Will do, thanks!
z

Zach Klippenstein (he/him) [MOD]

01/24/2022, 11:42 PM
Also please post back here when you file, in case others see this thread
l

Laura Kelly

01/24/2022, 11:52 PM
5 Views