Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Center share popup inside the browser window #5418

Merged

Conversation

AntonKhorev
Copy link
Collaborator

What the existing share popup window placement does is it places the popup horizontally in the center of the screen. I don't know if the popup can get placed literally in the corner (#5414 (comment)), maybe with a multi-monitor setup? But it still could be a surprising location if the monitor is large enough. Here the logic is changed to place the popup in the center of the browser window. Is it less surprising?

The only alternative to a popup window is a new tab, which is already available with middle click or context menu on share links.

@AntonKhorev AntonKhorev force-pushed the share-popup-center-window branch from 3fc487a to 2c57c66 Compare December 19, 2024 01:25
@tomhughes
Copy link
Member

It's definitely not centred for me:
image
Most likely either Firefox on linux or my Gnome/Wayland setup is ignoring the position.

@tomhughes
Copy link
Member

It works in Chromium so it must be a Firefox thing.

This is definitely better when it works anyway, so thanks.

@tomhughes
Copy link
Member

Firefox is reporting the screen size as 1920x1080 which is half the real size of my display so it's only centring in the top left quadrant :-( I assume it's some hidpi scaling thing but I'm struggling to find any mention of it anywhere on the web.

@tomhughes
Copy link
Member

Though the screen height and width don't actually affect anything if they're larger than 640x480 so actually I don't understand this code at all.

@tomhughes tomhughes merged commit b3c5010 into openstreetmap:master Dec 19, 2024
22 checks passed
@AntonKhorev
Copy link
Collaborator Author

Screen size should be reported in css pixels according to MDN docs.

@AntonKhorev AntonKhorev deleted the share-popup-center-window branch December 19, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants