0

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

1
  • At a guess, have you tried onCloseQuickAction instead of oncloseQuickAction?
    – Nick C
    Commented May 11, 2021 at 6:02

1 Answer 1

1

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

1
  • 1
    I can't believe this isn't more widely documented. Felt like I was never going to get it to work and then went all lower case and it worked first try. Thanks!
    – dhochee
    Commented Aug 12 at 22:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .