https://kotlinlang.org logo
p

Photoxor

02/01/2021, 2:41 AM
The behavior of
Popup
has changed in alpha11. Width is now limited to parent width. Is this intended?
m

matvei

02/01/2021, 11:12 AM
cc @Louis Pullen-Freilich [G] as he might know more info
👍 1
l

Louis Pullen-Freilich [G]

02/01/2021, 1:09 PM
I'm not aware of any changes here, if you have a simple reproduction could you file a bug?
p

Piotr Prus

02/03/2021, 9:48 PM
@Photoxor In my opinion, the width is limited to ~75% of screen width, even if child has midifier.fillMaxWidth(). In which version of compose the popup was full width? I want to compare the codebase and file an issue.
Guys, I prepared an easy to check scenario:
Copy code
@Composable
fun DropdownTest() {

    val (showMenu, setVisibility) = remember { mutableStateOf(true) }
    if (showMenu) {
        Popup(
            alignment = Alignment.TopCenter,
            isFocusable = true,
            onDismissRequest = { setVisibility(false) },
        ) {
            Column(
                modifier = Modifier
                    .fillMaxWidth()
                    .background(Color.Gray)
            ) {
                Text(text = "This should take the whole width, but it takes around 75-80%")
                Text(text = "Is that intended?")
            }
        }
    }
}
Calling above code in
setContent
results in following:
l

Louis Pullen-Freilich [G]

02/03/2021, 10:23 PM
Thanks! Would you mind filing a bug with this information?
Was this not the case for before alpha11?
p

Piotr Prus

02/04/2021, 5:46 AM
I have checked alpha 8 and 9. I will check few more and report an issue