Given this Minimum Reproducable Example: ```fun ma...
# compose-desktop
x
Given this Minimum Reproducable Example:
Copy code
fun main() {
    Window(title = "CK3 Mod Workbench") {
        MaterialTheme() {
            val currentDialog = remember { mutableStateOf("noDialog") }

            if (currentDialog.value == "characterDialog") Dialog(
                onDismissRequest = { currentDialog.value = "noDialog" }
            ) {
                Button(onClick = { currentDialog.value = "noDialog" }) {
                    Text("Close Dialog")
                }
            }
            Button(onClick = { currentDialog.value = "characterDialog" }
            ) { Text("Open Dialog") }
        }
    }
}
I always end up with this exception preventing the dialog from being reopened:
Copy code
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Anchor refers to a group that was removed
Any idea what is going wrong here? I tried so many things but I just do not understand the problem.
k
https://github.com/JetBrains/compose-jb/issues/199 is the place to track it. Since this is happening in the core Compose stack, it might take until after New Year's to get fixed
d
s/might/will/
👆 1
x
Uff sorry I forgot that I opened that issue
Any alternative to achieve a dialog to close? I mean it's kinda pointless to be able to open a dialog and not being able to close it properly right?
i
Try 0.0.0-unmerged-build21, bug should be fixed in this version. It is the latest androidx-main + swing interop + fixed some bugs
x
hm with that build my hold menubar does not work anyway - that's not a good tradeoff 😄