I can't seem to be able to set a proper `weight(1f...
# compose
s
I can't seem to be able to set a proper
weight(1f)
on a
RangeSlider
. Am I doing something funny, or is this a bug with the component?
Copy code
@Preview
@Composable
fun RangeSliderTest() {
    var values by remember { mutableStateOf(0f..1f) }

    Row(
        modifier = Modifier.background(Color.White).fillMaxWidth().padding(16.dp),
        verticalAlignment = Alignment.CenterVertically,
        horizontalArrangement = Arrangement.spacedBy(16.dp),
    ) {
        Text("0")
        RangeSlider(
            modifier = Modifier.weight(1f),
            values = values,
            valueRange = 0f..1f,
            onValueChange = { values = it },
        )
        Text("1")
    }
}
k
Comment on https://issuetracker.google.com/issues/216912877?pli=1 says it should work, so attach your code snippet and screenshot there
s
Oh, thanks! 🙌
y
Use
weight(1f, fill = false)
it should work
s
That seems to have no effect, either. I'll post in the issue tracker. 👍
Oh, that seems to work for the regular
Slider
, but not for
RangeSlider
, apparently. 🤔
blob thinking upside down 2
And there's a separate issue for the
RangeSlider
at https://issuetracker.google.com/issues/210289161.