How to disable a pop-up that is displayed over another popup

I am displaying a smaller pop-up over a larger one, how can I disable the first one (for it to be greyed out) and only make the second smaller popup clickable. I noticed that Mendix creates a grey div behind each popup page, the problem was the z-index of the second div created for the second popup page was too low, so they were order like this: grey div – grey div – first popup – second popup Instead of like this grey div –  first popup – grey div – second popup Is there a way to edit the mx.underlay class within Mendix to accommodate for this? 
1 answers

Adjusting the mx.underlay would be my last approach and you would need to get your hands on the proprietary Mendix code, which is not publicly shared.

I red something about changing a popup into an overlay, by adding a class to the second popup-page and change the styling using scss.

And you may find a solution in these previous forum-posts:, making the second a modal-popup, adding some smart javascript