https://kotlinlang.org logo
Title
k

Kirill Grouchnikov

11/24/2020, 6:51 PM
Is there some kind of a timing threshold on
clickable
and
toggleable
modifiers? When I do the "regular" down/up mouse click, I see the matching
onClick
and
onValueChange
getting fired. But if I do a mouse down, wait for a second or so, and then do a mouse up, those lambdas do not get fired.
i

Igor Demin

11/25/2020, 11:18 AM
I tested this snippet:
import androidx.compose.desktop.Window
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp

fun main() = Window {
    Box(Modifier.size(1000.dp).clickable {
        println("Click")
    })
}
And if I do a mouse down, wait for a second, do a mouse up then onClick is still fired. Can you provide your snippet and version of compose?
k

Kirill Grouchnikov

11/25/2020, 1:57 PM