Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Word][Office Dialog] Office dialog does not send an event if it closed by ESC key #5200

Open
3 tasks
shinji-morimitsu opened this issue Dec 17, 2024 · 2 comments
Labels
Area: Word Issue related to Word add-ins Status: in backlog Issue is being tracked in the backlog but timeline for resolution is unknown

Comments

@shinji-morimitsu
Copy link

Provide required information needed to triage your issue

Office Dialog (Office.context.ui.displayDialogAsync) does not fire an event, if it is closed by ESC key.

Note:
If it is closed by Alt-F4 or right-top 'X' button, {"type":"dialogEventReceived","error":12006} is recieved.

Your Environment

  • Platform : PC desktop
  • Host : Word
  • Office version number: 2501 (Build 18407.20002)
  • Operating System: Windows 11
  • Browser (if using Office on the web): ______

Expected behavior

Office.EventType.DialogEventReceived is fired.

Current behavior

No event is triggered.

Steps to reproduce

  1. Paste 'live example' code in script lab
  2. run
  3. Touch ESC key for dialog

Link to live example(s)

async function run() {
  Office.context.ui.displayDialogAsync(
    'https://script-lab.public.cdn.office.net/script-lab/',
    { height: 30, width: 30, displayInIframe: true, promptBeforeOpen: false },
    ({ value }) => {
      console.log(`callback is called`);
      value.addEventHandler(
        Office.EventType.DialogMessageReceived,
        ({ message }: { message: string; origin: string | undefined }) => {
          console.log(`message: ${JSON.stringify(message)}`);
        },
      );
      value.addEventHandler(
        Office.EventType.DialogEventReceived, (event: { error: number }) => {
          console.log(`event: ${JSON.stringify(event)}`);
        }
      );
    }
  );
}

Provide additional details




Context

Actually, we display dismisser while dialog opens, so it becomes terrible state if dialog is closed without events.

Useful logs

  • Console errors
  • Screenshots
  • Test file (if only happens on a particular file)

Thank you for taking the time to report an issue. Our triage team will respond to you in less than 72 hours. Normally, response time is <10 hours Monday through Friday. We do not triage on weekends.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Dec 17, 2024
@DominikDoom
Copy link

I was just about to write a similar issue myself.

We also recently encountered this bug in our Outlook Addin on Classic Outlook for Windows. The dialog sends no close event and also seems to not clear itself up properly if closed via ESC. This is really bad as we open ours from the task pane, meaning that even though the popup was closed, the API refuses to open a new one since only one at a time is allowed. The user has to completely close and reopen the task pane (killing the underlying webview process) to be able to open the dialog again.

It seems to be the same issue already discovered years ago in #9, and still not fixed to this day.

Additional observations:

  • It works correctly in the web, so i suspect the issue is the Win32 clients don't release the popup window's resources correctly after ESC, leading to undefined behavior.
  • Killing the addin's webview process in the task manager also fixes the bugged state, similar to closing and reopening the task pane. Reloading the webview page doesn't.
  • From a bit of logging:
    image

@RuizhiSunMS RuizhiSunMS added Area: Word Issue related to Word add-ins Status: in backlog Issue is being tracked in the backlog but timeline for resolution is unknown and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels Dec 17, 2024
@RuizhiSunMS
Copy link

Hi @shinji-morimitsu and @DominikDoom, thx for reaching out here. Will involve experts to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Word Issue related to Word add-ins Status: in backlog Issue is being tracked in the backlog but timeline for resolution is unknown
Projects
None yet
Development

No branches or pull requests

3 participants