Why neither `onPress` nor `onTap` getting triggere...
# compose-desktop
t
Why neither
onPress
nor
onTap
getting triggered on
Button
? 🤔 🧵
Copy code
Button(
    modifier = Modifier
        .pointerInput(Unit) {
            detectTapGestures(
                onPress = {
                    println("Pressed")
                },
                onTap = {
                    println("Tapped")
                }
            )
        },
    onClick = {}
) {
    Text("Hello")
}
I need to get the clicked offset to do my business logic, but its not getting triggered.
d
I think the button is already capturing that event before you can.
👀 1
🆗 1
t
Confirmed. You are right.
k
So what was your solution? Thanks!
t
@Kebbin I haven’t tried any, but I’ll be either wrap the
Button
with
Surface
or use
Text
.
k
OK. Thanks! Still trying to learn a lot about all this stuff!