elye
01/19/2024, 7:18 AM.clickable
, every works fine.
However, when I have .clickable
, the first click and drag on the thumb will reset the value of slider to 0 as illustrated in the gif shared.
Note
• Just click without dragging, it's fine
• This happened only on the first click and drag.
Slider(
value = ....
thumb = {
Spacer( modifier = Modifier
.clickable {}
...
)
}
)
Why is that happening? Did I miss something, or this is a Compose's bug?
If this is a Compose's bug, is there a workaround (to detect the thumb is clicked, without using .clickable
)?
I have also post on StackOverflow with the complete code that can reproduce this issue. Thanks!!elye
01/19/2024, 9:18 AMOmkar Amberkar
01/19/2024, 7:47 PMpointerInput(state, interactionSource) {
detectTapGestures(
onPress = { state.onPress(it) },
onTap = {
state.dispatchRawDelta(0f)
state.gestureEndAction()
}
)
}