https://kotlinlang.org logo
v

Vinay Gaba

06/07/2020, 11:47 PM
Trying to use the
testTag
Modifier on a Text composable that’s a part of the AdapterList. I’m getting this error
Copy code
java.lang.IllegalStateException: merge function called on unmergeable property TestTag. Existing value: Composable1, new value: Composable2. You may need to add a semantic boundary.
	at androidx.ui.semantics.SemanticsPropertyKey.merge(SemanticsProperties.kt:95)
Do I need to use this differently when used inside an AdapterList?
l

Leland Richardson [G]

06/08/2020, 5:05 PM
cc @Ryan Mentley
r

Ryan Mentley

06/08/2020, 8:55 PM
Does the AdapterList also have a test tag?
v

Vinay Gaba

06/08/2020, 9:20 PM
I believe it didn’t when I tested this first but now it does. I’ll try it again with tags at both the places and report back. Thanks for the tip!
r

Ryan Mentley

06/09/2020, 12:18 AM
Rather, I expect that might cause it - or at least, something above it having a test tag would
We're making some changes in this area to make it a little more intuitive
The specific issue you're running into has been addressed, but it's not released
In the meantime, if you put a semantics with
container = true
around your
AdapterList
items, that should fix it
v

Vinay Gaba

06/09/2020, 12:42 AM
Is it recommended to wrap with a Semantics in production code?
asked differently, what is the cost of using Semantics?
r

Ryan Mentley

06/11/2020, 9:22 PM
Generally, setting Semantics correctly for production code will enable accessibility to work properly. This area is in a bit of flux currently, though, so you won't need to (i.e., it will automatically do the right thing) after some of our changes