You need to sign in to do that
Don't have an account?

e.force:closeQuickAction is not working after Winter '20 preview on sandbox.
Hi Everyone,
does anyone know why the $A.get("e.force:closeQuickAction").fire(); event is not working on aura component after the Winter '20 sandbox update? Or anyone experienced this issue?
does anyone know why the $A.get("e.force:closeQuickAction").fire(); event is not working on aura component after the Winter '20 sandbox update? Or anyone experienced this issue?
If you are implementing lightningQuickActionWithoutHeader and having a custom lightning button to close the modal window using $A.get("e.force:closeQuickAction")fire(); event, it will not work after the update. The modal popup will remain open and will not close.
Experiencing the same behavior, exactly as you described with a component implementing lightningQuickActionWithoutHeader . . .
Thanks for creating the known issue,
The workaround is insufficient, in that I also use the "e.force.closeQuickAction" event to close the quick action dialog after a successful Save!
It's nice that the "save" completes as expected, and I move the user to the newly created case tab in service console. But, there's still a tab labeled "loading . . ." which is the original QuickAction dialog and it's just begging to be saved again, and so on.
Not being able to close the dialog when needed, is a big problem.
Thanks,
-Brian
Got a "Real" Workaround:
// Original
$A.get("e.force:closeQuickAction").fire();
// Workaround
var element = document.getElementsByClassName("DESKTOP uiModal forceModal");
element.forEach(function(e, t) {
$A.util.addClass(e, 'slds-hide');
});
-Brian
var element = document.getElementsByClassName("DESKTOP uiModal forceModal");
element.forEach(function(e, t) {
$A.util.addClass(e, 'slds-hide');
});
$A.get("e.force:refreshView").fire();
// Declare this at the start of your function and then
var close = $A.get('e.force:closeQuickAction');
// use this where you want to close the quick action.
close.fire();
My VF page communicates with the Aura-wrapper component via widnow.postMessage(), hence my code looks somthing like this:
```
var handleMessage = $A.getCallback(function (message) {
if (some_logic) {
$A.get('e.force:closeQuickAction').fire();
window.removeEventListener('message', handleMessage);
};
});
window.addEventListener('message', handleMessage);
```
What didn't work looks something like this:
```
window.addEventListener('message', function handleMessage(messasge) {
if (some_logic) {
$A.get('e.force:closeQuickAction').fire();
window.removeEventListener('message', handleMessage);
};
});
```
I came from the ReactJS world, so it seems to that the getCallback() wrapper provides something similar to the hooks in reactJS behind the scences.
Documents here: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_cb_mod_ext_js.htm