2

I have a quick Action button on Account page which is calling the LWC lightning-quick-action-panel component. By clicking on the quick Action button a model box opens, now when I refresh the Account page, the opened quick Action is not closing. it stays on the screen.

Does anyone know how to close this Quick Action model box when the page is refreshed?

3
  • Can you share your component code? May 13, 2022 at 11:43
  • I think CloseActionScreenEvent should resolve your issue.
    – Elijah
    May 13, 2022 at 17:16
  • CloseActionScreenEvent is used to close the model box when user click the Cancel button. But when user refreshed the browser page after clicking on the quick action button, the opened Quick Action model box is not closed after page is refreshed.
    – Subramani
    May 15, 2022 at 8:40

1 Answer 1

0

I had faced the same issue, you can prevent the component from being refreshed by using track decorator

@track hasRendered = false; // To Prevent Modal from ReRendered once Disconnected

in connected Callback

    connectedCallback() {
    Promise.all([
        loadStyle(this, modal)
    ]).then(() => {
        this.getBundles();
    });
}

then in your disconnected callback

    disconnectedCallback() {
    this.hasRendered = true;
    // location.reload(); // Don't use this. It will revoke your modal-calling Promise because this initialize all properties so track-ed property indicator doesn't work as expected
}
1

You must log in to answer this question.

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