Open andrewharvey opened 6 years ago
Doesn't anchor
already operate as the "preferred anchor"? it simply falls back to bottom
if nothing else is set. Would fixedAnchor
just be a boolean that determines whether the collision detection with the edge of the viewport happens?
http://jsbin.com/laderob/edit?html,output
If I set anchor
then it will happily get clipped off the map, so right now I can't prefer an anchor while avoiding the popup getting clipped, it's one or the other but not both.
Would fixedAnchor just be a boolean that determines whether the collision detection with the edge of the viewport happens?
Correct
Yeah, I like the fixedAnchor
approach. If we default it to true
it's not even a breaking change, right?
Yeah, I like the fixedAnchor approach. If we default it to true it's not even a breaking change, right?
I like it too. Currently:
{ anchor: 'bottom' }
is fixed
{ anchor: 'left' }
is fixed
{ }
is dynamic
We have to decide between:
fixedAnchor
depends on if anchor
is defined, orfixedAnchor
is always false
I want to leave my vote for the feature.
Typically monitors are more wide, than tall. So, from user experience perspective it is more friendly to display large popups on the left or right (where we much more space), rather then trying to fit it in the top or bottom half of the screen (like default behavior does).
can we remove the breaking change tag? The implementation in the PR is backwards compatible with the current API
The Popup
anchor
option is documented asI'd like to retain the dynamic feature to ensure the popup doesn't fall off the map, while setting a preference other than
bottom
.I think the best solution is to change the definition of the
anchor
option to be the preferred anchor and introduce a newfixedAnchor
option to tell if you want it to avoid falling of the map or not.This is a backwards incompatible change, but I think any change made in a backwards compatible way would introduce to much complexity to the API (for example leaving anchor as is and adding a new
anchorPreference
option).I don't mind trying to do a PR, but what do people think about this breaking change?