Office.context.ui.displayDialogAsync Dialog does not close

Viewed 992

When pressing the close button (x) of the Dialog (displayed in an iframe) the displayed iframe is removed, but the panel including the close button and heading still remains. I found following error in the logs, but I'm not sure if it is related TypeError: o.get_contextActivationManager is not a function occurred in owa.clientnext.extensibility.js:7:1898.

The Exchange server version is 15.1 ‎(Build 1034.26)‎. The Probelm occured in

  • Firefox 55.0.3 (32-Bit)
  • Chrome 61.0.3163.100 (Offizieller Build) (64-Bit)
  • IE 11.0.9600.18792

I use following function to create the dialog:

export async function GetFiles(): Promise<string[]> {

    return new Promise<string[]>((resolve, reject) => {

        Office.context.ui.displayDialogAsync(window.location.origin +
            '/exchangeAddIn/UploadDialog/index.html',
            {
                height: 50,
                width: 50,
                displayInIframe: true
            },
            (asyncResult: Office.AsyncResult) => {
                if (asyncResult.status === Office.AsyncResultStatus.Failed) {
                    Logger.error('Faild Dialog %o', asyncResult);
                    reject();
                }
                else {
                    let dialogHandler = asyncResult.value as Office.DialogHandler;

                    dialogHandler.addEventHandler(
                        Office.EventType.DialogMessageReceived, (args: any) => {
                            dialogHandler.close();
                            if (args.message == null) {
                                resolve();
                            }
                            let array = JSON.parse(args.message) as string[];
                            resolve(array);
                        });

                    dialogHandler.addEventHandler(
                        Office.EventType.DialogEventReceived, (arg: any) => {
                            reject();
                        });
                }
            });
    });

}
0 Answers
Related