closeModal()

Closes the currently open modal.

Note: This method can only be used in the code for a dashboard modal extension and therefore can't be used when when developing sites or building apps with Blocks.

Close Modal

Method Declaration

Copy

Parameters

NameTypeDescription
closeDataSerializableOptional. Data to pass to the modal's opener. This data is returned by openModal once the modal is closed. It must be Serializable data, which means it can be cloned using the structured clone algorithm. For example, you cannot pass function callbacks in this parameter.

Returns

void

Examples

Note: To call this method in self-hosted apps, you need to create a client. See the setup guide for more details.

Close a modal

Copy
Did this help?