How can I dismiss an asynchronous calloutbox?


#1

I’m using CallOutBox::launchAsynchronously() to start my callout. When the user interacts with certain components in the callout, I’d like to force the callout to be immediately dismissed. Can this be done, or is the only way to get a calloutbox to be dismissed is to wait for the user to click somewhere outside the callout?


#2

You just need to call exitModalState(result) on the CallOutBox


#3

And if you need to do it from a child component this will work:


#4

if you need to do it from a child component this will work:

findParentComponentOfClass<CallOutBox>()->exitModalState(0);

Thanks ! Just what I needed :)