function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Leticia Monteiro Freitas 4Leticia Monteiro Freitas 4 

Close a Modal in Lightning Component

I have a modal component that was called from another Component. I nedd to close the modal. How can I do that?
Raj VakatiRaj Vakati
Are you using the lightning:overlayLibrary  ??/ 


You can close it like this 

 
component.find("overlayLib").notifyClose();

handleCancel : function(component, event, helper) {
        //closes the modal or popover from the component
        component.find("overlayLib").notifyClose();
    },

 
Raj VakatiRaj Vakati
https://developer.salesforce.com/docs/component-library/bundle/lightning:overlayLibrary/documentation