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
667 stars 94 forks source link

OneNote web add-in opens two iframes in taskpane when taskpane button is pressed twice #4686

Open yxg10 opened 1 month ago

yxg10 commented 1 month ago

In OneNote web, when I click on the button to open my taskpane addin twice, it opens 2 iframes in the taskpane.

However if I press the button again (doesn't matter if the taskpane is still open or closed), it will create another iframe inside the same taskpane which results in two iframes horizontally placed next to each other.

The left iframe will fail to load and show the yellow Add-in error message above. The right iframe will load normally.

I have to refresh the page for it to go back to normal.

This is not limited to my add-in. Using the built-in Feed add-in from the Home tab also leads to this behaviour (press Feed twice to see it)

Your Environment

Expected behavior

The add-in page is refreshed. Only 1 iframe is present.

Current behavior

2 iframes are created.

Steps to reproduce

  1. Press the Feed add-in in Home.
  2. Press the button again (doesn't matter if the taskpane is still open or closed), it will create another iframe inside the same taskpane which results in two iframes horizontally placed next to each other.
  3. The left iframe will fail to load and show the yellow Add-in error message above. The right iframe will load normally.
  4. Refresh the page for it to go back to normal.
AlexJerabek commented 1 month ago

Thanks for reporting this @yxg10.

@EsterBergen, could you please investigate?

EsterBergen commented 1 month ago

@yxg10 - Thanks for reporting this. I don't see Feed double stacking, but I do see multiple Add-ins opening side by side in the browser (See below). I will check to see what the expected behavior is for taskpanes in One Note Web. image

Can you report a problem in One Note Online? Include a screenshot in the bug. image

yxg10 commented 1 month ago

Thanks for looking into this @EsterBergen. I may not have been clear on the issue when I initially reported it. The issue is not that multiple taskpanes of different addins open side by side. I believe that is fine and expected.

The issue is that (apparently only starting this week), pressing the same add-in twice causes 2 iframes to be loaded within the same taskpane of the addin. The issue is visible in your screenshot as you can see the horizontal scrollbar at the bottom of the add-ins' taskpanes. If you scroll them to the right you will see another copy of the same addin.

Inspecting the url of the iframes show that they both have the same url.

Normally pressing the addin button twice used to just refresh the addin.

This is a screenshot of what it looks like when you scroll to the right on the Feed addin.

image

I will report this separately to OneNote online as well.

EsterBergen commented 1 month ago

@yxg10 - Tried again today and it looks like the issue is resolved.

image

Do you see something similar on your end?

yxg10 commented 1 month ago

The same issue is still occurring for me, nothing appears to have changed unfortunately.

EsterBergen commented 1 month ago

@yxg10 - I see this when i open up the same add-in twice. This is a bug (9216582). We will track it and post updates here once available. Thank you for reporting this issue!