How can I dismiss an asynchronous calloutbox?

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?

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

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

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

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

Thanks ! Just what I needed :)