Topic: `clearAndSetSemantics` function this :poin...
# compose
t
Topic:
clearAndSetSemantics
function this 👇 removed the
testTag
from the merged tree
Copy code
Box(
    modifier = Modifier
        .clearAndSetSemantics {
            contentDescription = "My Red Box"
        }
        .testTag("red_box")
        .size(100.dp)
        .background(Color.Green)
) {

}
but moving the
clearAndSet
call after
testTag
doesn’t
Copy code
Box(
    modifier = Modifier
        .testTag("red_box")
        .clearAndSetSemantics {
            contentDescription = "My Red Box"
        }
        .size(100.dp)
        .background(Color.Green)

) {

}
Why modifier order works reverse here? 🤔
z
It’s not reverse. Modifiers always apply to stuff under/after them. The
clearAndSetSemantics
function clears the semantics of everything under/after it.
👍 1
t
ohk. thanks
@Zach Klippenstein (he/him) [MOD] isn’t that conflicting with this ? 🤔