Yet another weird case of semantics in Jetpack Compose....
val list = listOf("String 1", "String 2", "String 3")
Column(
Modifier.semantics { contentDescription = "test" }
) {
list.forEach {
Text(it)
}
}
If you use this code and then use TalkBack for some reason the first Text
will be highlighted and then when you swipe the Column
will highlight and then swipe once more and you'll be taken to the second label. After that it acts normal. I'm thinking something in the semantic hierarchy of the version of compose I'm on is completely messed up. But I don't know how to prove it. LayoutInspector shows everything as it should as as I expect it would. But something is not translating.
Is anyone aware of this? I am not sure where to report these semantics issues or research their problems. I'm still learning some compose aspects.
So I found out a lot of information today. I misunderstood my own problem at first and realized I needed to validate previous versions. In this question I was using 1.4.0
of compose. In this case, foundation and compose-ui.
As it turns out 1.4.0 is when this issue was introduced.
I have begun tracking this issue with the Open Source Project here. The gist of the issue seems to fall into a bug fix for UI, but oddly enough foundation causes the same issue. I've yet to determine the cause of that issue.
Using compose-ui#1.3.3 and foundation#1.3.1 does remedy this. Which is not ideal. I do not currently have a solution better to this. If you're wanting some of the functionality of 1.4.0; 1.4.0-beta01 is the latest version that does not have this issue for both UI and Foundation. Moving to 1.4.0-beta02 of either will introduce the issue.
Future of this issue::
There seems to be a semantic parameter added to compose-ui#1.4.0 called isContainer
. This may be the resolution they are already working on moving forward, but we do not have any details on the effort at this time.