I have encountered a problem that when I open a dialog through the dialog API the dialog will
be shown properly (picture of loaded dialog), but when I click outside the dialog and press the Esc key the Add-in will be closed but the dialog will remain visible
and became fully unresponsive to further user interactions (picture of stuck dialog). In this case I did not get any error messages (even my event handler for the DialogEventReceived
was not called).
If I click inside the dialog and press the Esc key the dialog will be closed properly (like after pressing the 'X' button of the dialog).
In this case my event handler will be called and there I get the 12006
error code.
Originally I ran into this issue in an Outlook Add-in built with Angular. Later I created an Outlook Web Add-in project which only opens the requested dialog, and with that Add-in I also ran into the same issue.
The function where I call the dialog API (from the Outlook Web Add-in project):
function openDialogAsIframe() {
var dialog;
Office.context.ui.displayDialogAsync(window.location.origin + "/Dialog.html",
{ height: 16, width: 14, displayInIframe: true }, (asyncResult) => {
dialog = asyncResult.value;
dialog.addEventHandler(Office.EventType.DialogMessageReceived, (arg) => {
console.log(arg.message);
dialog.close();
});
dialog.addEventHandler(Office.EventType.DialogEventReceived, (arg) => {
console.log(arg.error);
dialog.close();
});
});
}
I reproduced this issue with the following web browsers:
- Google Chrome - Version 93.0.4577.63
- Microsoft Edge - Version 93.0.961.38
- Firefox - 91.0.2
Is there any solution for this issue?