I noticed that using a `Slider` within a row does ...
# compose-desktop
y
I noticed that using a
Slider
within a row does not work if the other elements in the row change sizes (see attached screenshot). Code that demonstrates the behavior
Copy code
fun main() = singleWindowApplication {
    var zoom by remember { mutableStateOf(1f) }
    Row {
        Text(text = "Zoom = ${zoom}")
//        Text(text = "Hello") // using a "static" text fixes the issue
        Slider(value = zoom, valueRange = 0.25f..1.5f, onValueChange = { zoom = it })
    }
}
Is this an expected behavior or is this a bug that I should report somewhere?
😕 1
🐛 1
f
Cool phone number selector
😅 3
x
Feels like intended behaviour
🤔 2
d
I think that's bad UX and can lead to other bugs what happens if the slider is still being clicked and the slider moves to the left, then the slide will have to be moved to the right because that's where the mouse is, but that will trigger a new value in the text which will redraw the text and move the slider again and so on