Open
Description
Specification
https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-requestclose
Description
The requestClose() method of the HTMLDialogElement interface requests to close the . An optional string may be passed as an argument, updating the returnValue of the dialog.
This method differs from the HTMLDialogElement.close() method by firing a cancel event before firing the close event. This allows authors to prevent the dialog from closing. This method exposes the same behavior as the dialog's internal close watcher.
Documentation
https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/requestClose
Browser support
A new method requeatClose()
was recently added to Dialog in Chrome 134 and Safari Tech Preview.