https://kotlinlang.org logo
Title
a

Ahmad Daneshvar

07/30/2022, 3:51 PM
For those with the same problem, I’ve found a solution that works like a charm. Just add this modifier the component that you want it to consume the clicks:
Modifier.mouseClickable{}
Also, it’s need to transfer the focus to the one of modal items. You can do this by the
focusRequester
and then call
focusRequester.requestFocus
on it. By this way you can open new custom modal and transfer focus from main window to it. Thats it!
Forgot to mention, for low level interception, Instead of
Modifier.mouseClickable
, use this one:
Modifier.onPointerEvent(PointerEventType.Press, pass = PointerEventPass.Main) { /* Click closure */}
a

Afzal Najam

08/24/2022, 7:58 PM
Is there no Dialog API? It would be better to use that as this would require extra steps to ensure that it is accessible.