I’m working on accessibility for a custom checkbox...
# compose
l
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
That sounds like a bug to me, go ahead and file it
👀 2
👍 2
l
Will do, thanks!
z
Also please post back here when you file, in case others see this thread
l