MauroDataMapper/mdm-ui

Modal dialog closing when you click outside

Closed this issue · 1 comments

Dialog boxes close when you click in the surrounding area. If you've already added some text, then that gets lost.

  1. Go to a draft terminology and the lost of terms
  2. Click "Add terms"
  3. Add some text - code, definition, description
  4. Click outside the modal window
  5. Text is now missing - it also doesn't reappear when you reopen the dialog.

One solution would be to pop up the confirmation dialog when you click outside a modal window. Another might be to stop the form closing when you click outside.

A MatDialog has the option to close the dialog when clicking on the overlay container (the darkened area around the dialog window). Sometimes this is useful, such as when wanting to not confirm (cancel) an action by default, but clearly in some cases it isn't desirable.

In scenarios like this where it is not wanted, it is simple to switch off via MatDialog options, but only at the call site where used.