-
-
Notifications
You must be signed in to change notification settings - Fork 920
feat(popup): introduce configurable popupPadding to clamp popup within map viewport (#5978) #6106
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
base: main
Are you sure you want to change the base?
feat(popup): introduce configurable popupPadding to clamp popup within map viewport (#5978) #6106
Conversation
|
Thanks for taking the time to open this PR. Also note that creating a default that is different than current implantation is a breaking change and should not be made without proper planning of a breaking change version. |
|
Thanks for the feedback! Also, I personally prefer this approach as it stays minimal and intuitive without introducing additional API surface. Let me know if you'd like to move forward with this version or prefer closing in favor of #6052. |
|
I think that allowing to |
|
@shreeharshshinde what's the status of this PR? |
|
How is this PR different than #6052? (Besides the fact that the other PR is "stale") |
|
The previous implementation mentioned in the feedback included:
However, the current implementation in the codebase uses a simpler approach:
|
src/ui/popup.ts
Outdated
| * { top: '20px', right: '30px', bottom: '40px', left: '10px' } | ||
| * ``` | ||
| */ | ||
| popupPadding?: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CSS style can have 1, 2 or 4 values, which is not the case here, I would recommend updating the docs or the type.
src/ui/popup.ts
Outdated
| this._container.style.maxWidth = this.options.maxWidth; | ||
| } | ||
| // Apply popupPadding as CSS | ||
| const padding = this.options.popupPadding; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part looks duplicated.
|
@HarelM I am not getting why still those build test are failing ? What is the reason behind it ? |
|
You need to update the build size to accommodate for the code changes. |
Popup Padding Support
This PR introduces a new
popupPaddingoption to thePopupclass to address issue #5978.The padding ensures that the popup remains within the visible area of the map by clamping its position based on user-defined or default padding values.
Key Changes
Added
popupPaddingtoPopupOptions:Default padding values are set to :
Example Usage