v

    Vinay Gaba

    2 years ago
    Trying to use the
    testTag
    Modifier on a Text composable that’s a part of the AdapterList. I’m getting this error
    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]

    2 years ago
    cc @Ryan Mentley
    r

    Ryan Mentley

    2 years ago
    Does the AdapterList also have a test tag?
    v

    Vinay Gaba

    2 years ago
    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

    2 years ago
    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

    2 years ago
    Is it recommended to wrap with a Semantics in production code?
    asked differently, what is the cost of using Semantics?
    r

    Ryan Mentley

    2 years ago
    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