I am trying to receive both click and double click...
# compose
m
I am trying to receive both click and double click events on an element. Using
Modifier.onClick(onClick = {}, onDoubleClick = {})
works, but the problem is the click events are delayed. It seems the Modifier waits to see if it's a double click before deciding it's a single click and firing that event. Is there an existing way to avoid this delay? I am fine with receiving both the click and then double click events when the element is double clicked. I can of course implement the double click detection myself, but I am wondering if I am missing something existing.
Copy code
.pointerInput(Unit) {
    detectTapGestures(
        onPress = { },
        onDoubleTap = { }
    )
}
This seems to have the behavior I want. The
onPress
is delivered on button down, not button up like normal clicks, but in my use case it's actually desirable.