Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
In a scrolling component e.g. in a LazyColumn, pressing on the RangeSlider and then dragging will result in the slider accepting the press and adjust the range. This is undesirable behaviour because it is then difficult to scroll through a screen with sliders without inadvertently changing their values.
For reference the standard compose Slider() correctly ignores presses when scrolling.
To reproduce, run this simple code. Press on the sliders and then drag up to initiate a scroll. Notice how the behavior of Slider and RangeSlider is different.
var sliderVal by remember { mutableFloatStateOf(0f) }
var rangeVal by remember { mutableStateOf(0f..1f) }
LazyColumn(
modifier = Modifier
.fillMaxSize()
.padding(50.dp)
) {
item {
Spacer(modifier = Modifier.height(100.dp))
Slider(
value = sliderVal,
onValueChange = { sliderVal = it }
)
Spacer(modifier = Modifier.height(100.dp))
RangeSlider(
value = rangeVal,
onValueChange = { rangeVal = it }
)
Spacer(modifier = Modifier.height(1000.dp))
}
}