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:
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.