https://kotlinlang.org logo
#compose
Title
# compose
p

Peter Mandeljc

02/13/2023, 1:49 PM
Is this correct way to merge semantics? My root composable does not have
SetText
semantic set like that.
Copy code
@Composable
fun MyTextField(
    text: String,
    onTextChanged: (String) -> Unit,
    modifier: Modifier,
) {
    Box(modifier = modifier
        .semantics(mergeDescendants = true) {}
    ) {
        Column {
            Row {
                BasicTextField(text, onTextChanged)
            }
        }
    }
}
Do I always need to add
Copy code
semantics(true) {
    setText { ... }
}
12 Views