Working with <dialog> elements? ๐Ÿค”

Don't use .close(), it ends the dialog immediately.

Use HTMLDialogElement.requestClose(), it fires a close event first, giving your app a chance to intercept it, useful for confirmation or animations.

Try now ๐Ÿ‘‡
developer.mozilla.org/en-US/do

0

If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.social/users/mdn/statuses/114868225137555101 on your instance and quote it. (Note that quoting is not supported in Mastodon.)