https://kotlinlang.org logo
Title
o

orangy

02/21/2021, 5:25 PM
I’m trying to use
Popup
, but after adding it to composition hierarchy
onDismissRequest
never gets called and mouse never registers clicks anywhere else (but the application is running and UI keeps updating).
Either debugger is lying to me or it calls wrong lambda – this is a call from the frame above after I set
isFocusable
true
But DropdownMenu works as expected…
i

Igor Demin

02/21/2021, 7:32 PM
Reproducer would help to figure out what is happenning )
o

orangy

02/21/2021, 7:33 PM
Huh, that’s already quite a big program, hard to find what’s essential… But I’ll try
So, after clicking on a “Wow!” box popup displays, but never dismisses
i

Igor Demin

02/21/2021, 7:46 PM
Just set isFocusable:
Popup(isFocusable = true, onDismissRequest = { popupState = false }) {
    Text("Popup", modifier = Modifier.size(120.dp).background(Color.Blue))
}
On your screenshot
isFocusable=true
though 🤔
o

orangy

02/21/2021, 8:42 PM
Indeed, with isfocusable it works here, but not in my real program. But again, in real program it is inside lazy grid
Right, here it doesn’t work
i

Igor Demin

02/21/2021, 10:33 PM
o

orangy

02/21/2021, 10:54 PM
As I said, debugger shows that another lambda is called, the one that is in
clickable
Maybe indeed runtime fails to distinguish these two lambdas