[SalesForce] Unable to close quick action from LWC (from Web component)

I'm directly using LWC component in the Quick Action through flow, once the submit button is called I'm dispatching an event from LWC but aura is not capturing and also Quick action modal is not closing.

Here is the code:

LWC

closeModalQuickAction() {
        this.dispatchEvent( new CustomEvent('closeQuickAction'));
    } 

Aura :

<aura:component implements ="force:lightningQuickActionWithoutHeader" >
    <c:dynamicInputTable oncloseQuickAction="{!c.closeModal}"/> 
</aura:component>

({
    closeModal : function(component, event, helper) {
        console.log("closing the popup");
        
        $A.get("e.force:closeQuickAction").fire();
    }
})

this is how I'm doing but nothing is happening

Best Answer

The issue is that you can't have Capital Letters in event name. Change closeQuickAction to either closequickaction or close_quick_action and it should work, sometimes LWC doesn't show it as error, but it'll never work with capital letters

Related Topic