Hello! I'm trying to place a Slider() inside a Dro...
# compose-desktop
w
Hello! I'm trying to place a Slider() inside a DropDownMenu() like in the following:
Copy code
@Composable
fun sliderDropDown(isExpanded: Boolean, onDismissRequest: () -> Unit) {
    DropdownMenu(expanded = isExpanded, onDismissRequest) {
        var value by remember { mutableStateOf(0f) }
        Slider(
            value,
            { value = it },
            Modifier.width(200.dp)
        )

    }
}
but I keep getting the error
Copy code
Intrinsic measurements are not currently supported by SubcomposeLayout
I'm able to use a Popup() to show the Slider, but I can't figure out a way to get the same anchoring behavior from the Popup that the DropDownMenu provides by default. Am I missing something when I use DropDownMenu? Is there a way to get the same anchoring effect with a Popup? I'm using compose-0.3.0 and kotlin-1.4.30
j
cc @Andrey Kulikov
@Will Johnson I would recommend filing a bug at https://issuetracker.google.com/issues?q=componentid:612128 because at the very least crashing with such an error message is very unclear to developers about what their next step should be. And if this is work intended to be done at a future date, the source code at that message string location should include a bug number.
w
Thanks, @jim. I just submitted the bug report https://issuetracker.google.com/u/1/issues/181220759 (my first since I started teaching myself to code last spring! 🥳 )
👍 2
🎉 1