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

Popup auto-anchoring should account for global padding #11841

Open
andrewharvey opened this issue May 2, 2022 · 1 comment · May be fixed by #11846
Open

Popup auto-anchoring should account for global padding #11841

andrewharvey opened this issue May 2, 2022 · 1 comment · May be fixed by #11846
Labels

Comments

@andrewharvey
Copy link
Collaborator

mapbox-gl-js version: 2.8.2

browser:

Steps to Trigger Behavior

  1. Add a popup to the map
  2. Set a global padding map.setPadding
  3. (for testing) map.showPadding = true
  4. Pan the map so the popup intersects the padding

Link to Demonstration

https://codepen.io/andrewharvey/pen/jOZOXGm

Expected Behavior

The auto anchoring of the popup should treat the padding similar to the map edge and re-anchor if it has space.

My reasoning is that global padding is usually set so that content is only shown in the background in that padded area and no focused content should appear there, though it probably does depend on what people are using padding for.

Actual Behavior

The popup will overflow into the global padding and only re-anchor on the map edge.

@andrewharvey
Copy link
Collaborator Author

Potential fix in https://github.com/mapbox/mapbox-gl-js/compare/11841-popup-anchor-padding but need to consider if this should be default (and only) behaviour, opt in, or opt out.

@andrewharvey andrewharvey linked a pull request May 4, 2022 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants