Search...
closeModal( )
Closes the currently open modal.
Description
This function can only be used in page code files for dashboard pages created in the Wix editor or with Wix Blocks.
Syntax
function closeModal([closeData: Serializable]): void
closeModal Parameters
NAME
TYPE
DESCRIPTION
closeData
Optional
Serializable
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
This function does not return anything.
Return Type:
void
Was this helpful?
Close a modal
Copy Code
1import { closeModal } from 'wix-dashboard';23// ...45closeModal({ message: 'The modal is closed!' });