I’m facing an issue when using DropdownMenu. I don...
# compose-desktop
a
I’m facing an issue when using DropdownMenu. I don’t know if it’s a bug or I’m missing something. More details in the thread.
Copy code
fun main() = application {
    var expanded by remember { mutableStateOf(false) }
    Window(this::exitApplication) {
        Box {
            Button(onClick = { expanded = !expanded }) {
                Text(if (expanded) "Collapse" else "Expand")
            }
            DropdownMenu(
                expanded,
                onDismissRequest = { expanded = false },
            ) {
                DropdownMenuItem(onClick = { expanded = false }) {
                    Text("Hello")
                }
            }
        }
    }
}
When I click on the Button, the menu doesn’t close. Sometimes it works, sometimes it doesn’t. macOS 1.2.0-alpha01-dev774
a
Maybe some of those clicks are double-clicks?
a
I don’t think so.