Context
The Office JavaScript API defines the saveAsync
method to persist settings into the document (e.g. the PowerPoint presentation).
This is an asynchronous method which triggers a callback once the setting has been persisted. In some cases, the callback is never called. This repo shows such a case where the callback is never called when a selector is present in the HTML.
System information
This issue was reproduced with
- Microsoft PowerPoint for Office 365 MSO (16.0.12527.21096) 64-bit with a developer license
- Windows 10 Pro, version 2004, OS build 19041.572
How to run this add-in
- Follow the instructions to sideload an Office Add-in for testing. The manifest is located in this repo
./manifest.xml
- To run the add-in, we used VSCode and the Live Server extension.
If you encounter the issue "We can't open this add-in from localhost" when loading an Office Add-in or using Fiddler, you might have to run the following command in the command prompt as administrator (source)
CheckNetIsolation LoopbackExempt -a -n="microsoft.win32webviewhost_cw5n1h2txyewy"
How to reproduce the issue
Once the Live Server is running, do the following:
- Open PowerPoint
- Create a new presentation
- Insert the "[dev] Counter" add-in
- Once loaded, click on "Increment". The state should update and the logs should display the
saveAsync
callback has been called. - Click on the
<select />
element and change its value. - Click on "Increment"
- Expected: the
saveAsync
callback is called (as displayed in the logs) - Actual: the
saveAsync
callback is never called (it doesn't show up in logs).
You can also find a video here which shows the issue.
Notes:
- The
<select />
does not serve a purpose other than reproducing this bug. It's not used in the code. - Even though the
saveAsync
callback is not called, the state is still persisted. This can be verified by saving the presentation and opening it once again.