1

Is it possible to stop the dialog from closing when using the accept/cancel listeners? I've now set a custom button in my dialog. Is there something build-in in the MDC-dialog component to handle this?

Thanks in advance!

Ken Gregory
  • 7,180
  • 1
  • 39
  • 43
Haidy
  • 259
  • 6
  • 19

1 Answers1

4

Accordingly, to the documentation, you can disable escape and click on the scrim by setting the following parameters.

const dialog_add_user = new mdc.dialog.MDCDialog(document.querySelector('#dialog_form_user'));
    dialog_add_user.escapeKeyAction = "";
    dialog_add_user.scrimClickAction = "";

Also, remove data-mdc-dialog-action="xxxxx" from your buttons to keep the dialog open.

I hope it helps.