OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
687 stars 94 forks source link

[Outlook] Changing a select drop down breaks pinning support #1100

Closed splinter closed 4 years ago

splinter commented 4 years ago

The ItemChanged event does not fire if a select dropdown value is changed.

Current Behavior

The ItemChanged event does not fire if a select drop value is changed.

Steps to Reproduce, or Live Example

  1. Setup an ItemChanged handler
  2. Ensure there is a Select dropdown in the view
  3. Change the select drop down
  4. The ItemChanged event does not fire.

I have attached a simple add-in in the gist below:

https://gist.github.com/splinter/0edeeee602ee5b691d799e7b292d6ded

Note: This behaviour is not present on systems with Chromium base Edge.

Context

The basic pinning use case of obtaining details on the currently selected mail is broken.

Your Environment

exextoc commented 4 years ago

The ItemChanged event is triggered when a different Outlook item is selected for viewing while the task pane is pinned. It will not fire when a dropdown is changed.

More information about event types can be found here

splinter commented 4 years ago

Hi @exextoc ,

First, I must apologize since I did not explain the issue properly.

The issue is not that the event is not fired when a select dropdown is changed.

The issue occurs when:

  1. User enables pinning
  2. User changes a select dropdown
  3. User changes mail
  4. No mail item changed event is fired
exextoc commented 4 years ago

Thanks for reporting this issue. We were able to repro this bug, and it has been put on our backlog. We unfortunately have no timelines to share at this point.

jargil commented 4 years ago

Thanks for reporting this. I've fixed this on Office builds 16.0.13001 and newer.

mwickens commented 4 years ago

Any chance there’s a work-around for this? Even once this is released, asking customers to upgrade in order to use our third-party add-in is not going to cut it.

jargil commented 4 years ago

@mwickens - this is fixed in 16.0.13001 and newer, are you still seeing this problem or are you in an older build? Is re-registering the events an option while waiting to get a newer Office build?

mwickens commented 4 years ago

Thanks for the quick reply. I was editing my comment when yours came in. As a third-party add-in, we can't ask all of our customers to upgrade (well, we can ask, but…). I'll look into re-registering the events.

exextoc commented 4 years ago

If you want to try the workaround of re-registering the events, ensure that you de-register (removeHandlerAsync) before re-registering (addHandlerAsync).

mwickens commented 4 years ago

Thanks, that worked!

aspantel commented 3 years ago

Hi Microsoft team, this bug seems to be back in the recent Outlook versions (i.e. Version 2107). Has anyone noticed this yet?

aspantel commented 3 years ago

image

jargil commented 3 years ago

@yoxel - could you open a new Issue listing all the details, preferable with a script we can use to reproduce. Could you also please confirm in your new Issue if your add-in is running on the WebView2 runtime?

Here's some information about the runtimes and how to confirm if you're on WebView2: https://developer.microsoft.com/en-us/office/blogs/understanding-office-add-ins-runtime/

aspantel commented 3 years ago

@jargil WebView2 was not installed. I'll have to open a bug report. The earlier suggested workaround does not help either for some reason. There is something on the JS console after re-registering the event handler:

Agave.HostCall.ReceiveResponse MicrosoftAjax.js (5,25542) Agave.HostCall.IssueCall MicrosoftAjax.js (5,25542) Agave.HostCall.ReceiveResponse MicrosoftAjax.js (5,25542)