Ahmad Daneshvar
07/28/2022, 3:11 PMmodal
behavior with a semi transparent background (Look at the attached). I have two Boxes that one of them contains other one. In the first box I have some focusable
and Clickable
items (Like button, textfield … ). When I show the second box over first box (Like a modal), the components in the first box is still clickable. The desired behavior is, when box2 overlays box1 and it content, I want box2 consumes mouse clicks and input functionalities from box1. I don’t know how it is possible. Should I handle the mouse clicks manually in the modal? Should i disable all components in the Box1 manually?
Thank you for your help in advance.Ahmad Daneshvar
07/30/2022, 3:51 PMModifier.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!Ahmad Daneshvar
07/30/2022, 4:55 PMModifier.mouseClickable
, use this one:
Modifier.onPointerEvent(PointerEventType.Press, pass = PointerEventPass.Main) { /* Click closure */}
Afzal Najam
08/24/2022, 7:58 PM