Describe the bug
When tapping multiple times on the same button/card quickly the final touch event doesn't finish.
Affected platforms
Desktop (Windows)
Versions
Kotlin version*: 1.9.23
Compose Multiplatform version*: 1.6.1
OS version(s)*: Windows 11
OS architecture: x64
Device (model or simulator for iOS issues): reproduced on elo touch monitor and acer touch monitor
JDK (for desktop issues): reproduced on both 21 and 11
To Reproduce
Steps and/or the code snippet to reproduce the behavior:
(Note: Click works as expected)
Double tap a button, if you have a counter tied to the button the counter will move up by one. You should notice the button will remain highlighted.
From there there are a couple scenarios.
3rd tap on the same button => counter will jump to 3
@Composable
@Preview
fun App() {
MaterialTheme {
var counter1 by remember { mutableStateOf(0) }
var counter2 by remember { mutableStateOf(0) }
var counter3 by remember { mutableStateOf(0) }
Describe the bug When tapping multiple times on the same button/card quickly the final touch event doesn't finish.
Affected platforms
Versions
To Reproduce Steps and/or the code snippet to reproduce the behavior: (Note: Click works as expected) Double tap a button, if you have a counter tied to the button the counter will move up by one. You should notice the button will remain highlighted. From there there are a couple scenarios.
` import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.material3.Button import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.MutableState import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import org.jetbrains.compose.ui.tooling.preview.Preview
@Composable @Preview fun App() { MaterialTheme { var counter1 by remember { mutableStateOf(0) } var counter2 by remember { mutableStateOf(0) } var counter3 by remember { mutableStateOf(0) }
}
@Composable fun ButtonWithCounter(buttonText: String, counter: MutableState, onClick: () -> Unit) {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.padding(8.dp)
) {
Button(onClick = onClick) {
Text(buttonText)
}
Text(text = "Counter: ${counter.value}")
}
}
`
Expected behavior I expect the button to fire the event when tapped, even if tapped over and over.
Screenshots