Edit in GitHubLog an issue

Showing a Modal Dialog

Dialogs are shown using the HTMLDialogElement#showModal method. This method will render the dialog. The method will return a Promise, which you can use to easily wait for the dialog to be dismissed.

Copied to your clipboard
dialog.showModal().then((result) => {
// handle dialog result
// if canceled by ESC, will be "reasonCanceled"
});

Info

The dialog element must be present in the DOM before showing it. If it isn't, the method will throw an exception.

It's important to note that you can only show one dialog at once. You should always close or dismiss a dialog first and then wait for the dialog's promise to resolve before showing another one.

  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.