I'm newbie when it comes to UX, there's a thing I don't understand and couldn't find answer to that. So I hear every now and then that modal on modal is bad. But I don't understand why and no one could explain it to me so far.
For example: We have web application where you can work on a document and you can invite people. Inviting people opens modal - it's self contained flow of permission management. You can invite, remove and change permissions of users. If you start changing permissions or removing people then you need to press "Save" button to confirm it all. If you try to leave modal without confirming then another small modal "You have unsaved changes, do you want to proceed?" is displayed. So I heard people saying this is "bad UX/bad solution", but why? This is exactly what Google implemented in their Google Docs. What would be "good UX" then?