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

Fix popup.trackPointer pointer cursor bug #3434

Merged
merged 4 commits into from
Dec 3, 2023
Merged

Fix popup.trackPointer pointer cursor bug #3434

merged 4 commits into from
Dec 3, 2023

Conversation

simondriesen
Copy link
Contributor

@simondriesen simondriesen commented Dec 2, 2023

Fixes #3405

Bug description

The ".maplibregl-track-pointer" CSS class get's added to the map when a popup uses its trackPointer method. This makes sure the map displays a pointer cursor. The issue is that when you disable the popup using its remove method it doesn't remove this CSS class from the map causing the cursor to be shown as a pointer indefinitely.

Changes

When using a popup's remove method it will make sure to remove the ".maplibregl-track-pointer" CSS class from the map.

Before:

After:

Launch Checklist

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • Briefly describe the changes in this PR.
  • Link to related issues.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality.
  • Add an entry to CHANGELOG.md under the ## main section.

@codecov-commenter
Copy link

codecov-commenter commented Dec 2, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3c78f81) 75.58% compared to head (32797f5) 75.58%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3434   +/-   ##
=======================================
  Coverage   75.58%   75.58%           
=======================================
  Files         243      243           
  Lines       19182    19183    +1     
  Branches     4247     4247           
=======================================
+ Hits        14498    14499    +1     
  Misses       4684     4684           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@HarelM
Copy link
Collaborator

HarelM commented Dec 3, 2023

Can you add some assert to a test to make sure this won't break in the future?

@HarelM HarelM enabled auto-merge (squash) December 3, 2023 11:32
@HarelM HarelM merged commit 47d7403 into maplibre:main Dec 3, 2023
14 checks passed
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.

Popup .trackPointer() changes cursor to pointer forever
3 participants