Skip to content

msal-browser popup position for dual screen #4528

Open
@waxisien

Description

@waxisien

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.

Setup example:
Screen Shot 2022-02-16 at 9 11 17 AM
Screen Shot 2022-02-16 at 9 10 47 AM

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)

Metadata

Metadata

Assignees

Labels

featureFeature requests.msal-browserRelated to msal-browser package

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions