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
686 stars 95 forks source link

Office.addin.showAsTaskpane() often shows gray screen #3157

Closed sclarke500 closed 7 months ago

sclarke500 commented 1 year ago

Message from office-js bot: We’re closing this issue because it has been inactive for a long time. We’re doing this to keep the issues list manageable and useful for everyone. If this issue is still relevant for you, please create a new issue. Thank you for your understanding and continued feedback.

Overview

A Word add in using shared runtime makes the showAsTaskpane call. About half of the time Word opens the panel, but displays a gray screen. Resizing the taskpane or Word window results in screen displaying properly.

Possible related issue https://github.com/OfficeDev/office-js/issues/2538 (but is Excel and does not seem to be occasional)

Environment

PC Desktop Word 2019 MSO (Version 2208 Build 16.0.15601.20280) 32-bit Windows 11

Expected behavior

Taskpane should display properly

Current behavior

Taskpane opens but shows an empty gray screen that does not respond to mouse clicks (ie right-click does nothing) Resizing the taskpane or resizing the Word window itself causes taskpane to display properly.

On doc open we often see:

Image1

After window resize:

Screenshot_4

Steps to reproduce

  1. Create a Word Addin using shared runtime;
  2. In the Office.onReady call set the startup behavior to load;
  3. In the onReady call also call showAsTaskpane();
  4. Open addin in a document & save the document;
  5. Open the document and the taskpane will display. Approx 50% of the time it will display as a gray screen.

minimal repo that reproduces issue: https://github.com/sclarke500/hello-world-addin

Context

In my use case I want to conditionally display the taskpane on document open, rather than setting it to always open. Example conditions are whether certain features are available, or the data linked to the document has changed.

EdwinStraver commented 1 year ago

Yes, I see this behavior extremely frequent in my Excel taskpane as well.

Edwin

EdwinStraver commented 1 year ago

P.S. i think this is the exact same issue as #3101