Description
Core Library
MSAL.js v2 (@azure/msal-browser)
Wrapper Library
Not Applicable
Description
Hello,
For dual screen setup, Popup cannot be positioned with negative values which occures depending of which screen is defined as the main one.
In both of those case the top
or left
variable will need negative values to position popup at the center of the screen, but negative values are ignored by openSizedPopup
function in lib/msal-browser/src/utils/PopupUtils.ts
, here is the snippet involved:
if (!top || top < 0 || top > winHeight) {
logger.verbose("Default popup window top position used. Window top not configured or invalid.");
top = Math.max(0, ((winHeight / 2) - (BrowserConstants.POPUP_HEIGHT / 2)) + winTop);
}
if (!left || left < 0 || left > winWidth) {
logger.verbose("Default popup window left position used. Window left not configured or invalid.");
left = Math.max(0, ((winWidth / 2) - (BrowserConstants.POPUP_WIDTH / 2)) + winLeft);
}
I makes it impossible for the application to position the popup at will using the popupWindowAttributes.popupPosition
attribute, resulting the popup to be automatically positioned to the 0 axis depending of the screen setup.
Are there reasons I am unaware of to restrict negative values for popup positioning?
Thank you
Source
External (Customer)