通过ESC关闭对话框时不会触发任何事件

时间:2017-09-04 13:10:33

标签: office-js outlook-web-addins

在OSX上使用Outlook Web App时会出现此问题。它已使用Chrome,Firefox和Safari进行复制。

方案

UI.displayDialogAsync()A::v选项一起使用。

如果用户点击ESC键,对话框将关闭但不会触发displayInIframe: true

除此之外,同样的对话框无法再次打开(可能因为某个地方打开的标志仍然设置为true或其他)。

预期行为

对话框关闭并发出错误Office.EventType.DialogEventReceived的事件(用户关闭对话框)。

当前行为

对话框关闭,不会发出任何内容,无法重新打开对话框。

代码

我们所有与OfficeJ相关的调用都包含在服务中,而在该服务中,我们有12006方法包裹openDialog

ui.displayDialogAsync

public openDialog(dialog: string, width: number, height: number, displayInIframe: boolean = true) : Promise < Office.DialogHandler > { return new Promise((resolve, reject) => { this.ui.displayDialogAsync(`https://${OWA_HOST}/${dialog}`, { width, height, displayInIframe }, (result) => { //... error handling + reject(result.value) resolve(result.value) }); }); } 然后在我们的Angular应用程序中的其他地方使用:

openDialog
Office返回

错误:

enter image description here

我也在Office.js CDN/NPM GitHub发布了此内容。

这个问题:OWA: Dialog API support是类似的,虽然我已经离开了我的问题,因为它是对同一个bug的更准确的描述。

0 个答案:

没有答案
相关问题