In xml, we can simply set android:importantforaccessibility to achieve such a goal.
However, in Jetpack Compose, I don't find any similar approach to do so.
Say, if I don't want a Text() composable to be selected and focused when Talkback is on, how should I do?
I tried this way but it won't work, as contentDescription should be NoNull:
modifier = modifier.semantics { contentDescription = null }
So then I tried to remove the initial default semantics of a Text composable:
modifier = modifier.clearAndSetSemantics { }
But this won't work too...
The talkback will still try to focus this Text components and read its content.
I also try to manipulate focusProperties() to skip this Text(), but I failed again.
SemanticsPropertyReceiver.invisibleToUser() is deprecated, so you can use:
Modifier.semantics{ hideFromAccessibility() }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With