Trying to use the `testTag` Modifier on a Text com...
# compose
v
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
cc @Ryan Mentley
r
Does the AdapterList also have a test tag?
v
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
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
Is it recommended to wrap with a Semantics in production code?
asked differently, what is the cost of using Semantics?
r
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