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 opening / closing tooltip while dragging map #7862

Merged

Conversation

Falke-Design
Copy link
Member

While dragging the map it can happen that the mouse is moved faster then the map and then on the marker is mouseover and mouseout fired. Then this flickering happens (opening / closing):

tooltip_flakering

To prevent this I added a check in openTooltip if the map is currently moving.

This means:

  • If the tooltip is open and while dragging mouseout is fired, it closes and don't opening again if mouseover is fired later.
  • If the tooltip is closed and mouseover is fired, it don't opens.

Fixed:
tooltip_flakering_fix
While the mouse is on the marker the tooltip keeps open, but if it goes away from the marker, mouseout is fired and the tooltip closes and is not opened again.

src/layer/Tooltip.js Outdated Show resolved Hide resolved
Co-authored-by: johnd0e <johnd0e@mail.ua>
@mourner mourner merged commit 26ba65a into Leaflet:master Dec 15, 2021
@Falke-Design Falke-Design deleted the fix/tooltip_flakering_while_dragging branch February 5, 2022 09:07
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.

3 participants