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

Event based outlook addin window.innerHeight returns 0 #3548

Open elemen7s opened 1 year ago

elemen7s commented 1 year ago

I have an event based Outlook addin with an ItemSend Event. When the user clicks on the Send button, I need to open a dialog using the displayDialogAsync. Since this only accepts a percentage for width/height I am calculating the ideal percentage based on the screen size for my content to fit without any scroll bars or extra space.

In javascript, window.innerHeight returns the value 0

In Firefox, even the window.outerHeight returns 0 while in chrome and edge, window.outerHeight returns the correct value.

Your Environment

Expected behavior

Expected behaviour is to have the correct values in the window object. Outlook should not change any of the original values of the window object or if it is being copied, all properties should be copied accordingly so that the correct values are used inside the addin.

Current behavior

Current behaviour is that window.innerHeight returns 0

Steps to reproduce

Any addin with any event such as ribbon button click or on send Call window.innerHeight Check value

exextoc commented 1 year ago

@elemen7s Thanks for reporting this issue regarding window height. It has been put on our backlog. We unfortunately have no timelines to share at this point Internal tracking id: Office: 3816286