Is there a way to make pointer events not propagat...
# compose-desktop
a
Is there a way to make pointer events not propagate to the parent? (similar to key event behavior) Perhaps I need to handle the event only in the parent and manually hit test to know if a child was hit
a
I think that happens by default:
Copy code
@OptIn(ExperimentalFoundationApi::class)
fun main() = singleWindowApplication(
    state = WindowState(
        size = DpSize(400.dp, 800.dp)
    )
) {
    Box(
        modifier = Modifier
            .fillMaxSize()
            .onClick { 
                println("Outer clicked")
            }
    ) {
        Box(
            modifier = Modifier
                .size(100.dp)
                .background(Color.Red)
                .onClick { 
                    println("Inner clicked")
                }
        )
    }
}
In the low-level pointer input API (Modifier.pointerInput) there’s
PointerInputChange.consume()