https://kotlinlang.org logo
#compose
Title
# compose
v

Vsevolod Ganin

06/13/2021, 3:11 PM
I have an issue with a
Slider
in scrollable list. When I start to scroll the list and hit slider’s track in the way, the thumb jumps to that position immediately and scroll also happens. Is there a way to workaround this problem? For example, for buttons such problem doesn’t exist. When I hit button when starting to drag, it doesn’t actually trigger
onClick
(the ripple effect is rendered anyway though).
Here is a quick test
Copy code
@Preview
@Composable
private fun Test() {
    Column(Modifier.verticalScroll(rememberScrollState())) {
        repeat(50) {
            val value = remember { mutableStateOf(0f) }
            Slider(
                value = value.value,
                onValueChange = { value.value = it },
            )
        }
    }
}
The game is called “try to scroll while not modifying any slider’s state”
m

matvei

06/14/2021, 10:57 AM
Sounds like a bug to me. Please file it in the issue tracker!
👍🏻 1
v

Vsevolod Ganin

06/14/2021, 2:06 PM
4 Views