Loading...
<button onclick="dlg.showModal()">Open</button>
<dialog id="dlg">...</dialog><button commandfor="dlg" command="show-modal">Open</button>
<dialog id="dlg">...</dialog>The button opens the modal dialog declaratively, with no click handler.
command='show-modal' with commandfor, not an onclick handler calling showModal().command event listener on the target.aria-label that names the action.Add a button inside it with commandfor set to the dialog id and command='close'.
Listen for the command event on the target and read event.command, like '--rotate'.