Hello, I have a very simple layout - parent `Box` ...
# compose
d
Hello, I have a very simple layout - parent
Box
and a single
Box
as a child. I have a long press listener on the parent and normal click listener on a child. My problem is - when I long press the child, the parent long press listener is not fired. Is there any way how to achieve this without specifying the long press listener on the child as well?
Copy code
Box(
    modifier = Modifier
        .fillMaxWidth()
        .combinedClickable(
            onLongClick = {
                Toast
                    .makeText(context, "Long click parent", Toast.LENGTH_SHORT)
                    .show()
            },
            onClick = {
                Toast
                    .makeText(context, "Normal click parent", Toast.LENGTH_SHORT)
                    .show()
            }
        )
        .padding(16.dp)
) {
    Box(
        modifier = Modifier
            .height(100.dp)
            .fillMaxWidth()
            .background(color = Color.Green)
            .clickable {
                Toast
                    .makeText(context, "Normal click child", Toast.LENGTH_SHORT)
                    .show()
            }
    )
}