When I call this composable I get two messages: ....
# compose
r
When I call this composable I get two messages: ... Slider onValueChange: 10.0 ... Slider onValueChange: 5.0 I was expecting only one callback, the second one.
Copy code
@Composable
fun SliderTest() {
    val sliderValue = remember { mutableStateOf(5f) }
    Slider(
            value = sliderValue.value,
            onValueChange = {
                Log.d("Slider onValueChange ", "$it")
                sliderValue.value = it
            },
            modifier = Modifier.width(200.dp),
            valueRange = 0f..10f,
    )
}
The first message is always for the end value in valueRange, 10 in this example. (I'm using Arctic Fox 2020.3.1 Canary 4, built on Dec 23, 2020.)
t
Both messages should not appear, it is a known bug. See: https://issuetracker.google.com/issues/175943373
r
Thanks for the quick response. (I'll try to do a better job of finding open bugs next time.)