Skip to content

Add dialog.requestClose() #2738

Open
@lukewarlow

Description

@lukewarlow

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature definitionCreating or defining new features or groups of features.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions