Clicking a feature 4 or more times quickly it makes it so you cannot move the map
I ran into a bug that occurs on v1.5.0 but not on v1.4.3
When I draw a polygon and click it 4 or more times in quickly I can no longer move the map.
I can still zoom, pan, tilt but click and drag will not move the map.
I was able to reproduce on both the mapbox and maplibre docs which are hosting the latest 1.5.0 version
https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-draw/ https://maplibre.org/maplibre-gl-js/docs/examples/mapbox-gl-draw/
Reproduction Steps
- Draw a polygon
- Click it 4 times quickly
- Try to move the map
We're experiencing the same issue. For us, it happens when drawing a line, selecting its endpoint, and moving it around. If the cursor moves outside the viewport, it gets stuck. Zooming, panning, and tilting still work, but moving the map does not.
Any update regarding this issue?
I can confirm I'm seeing the same issue
Just wanted to check if anyone has started looking into this issue, or if it might still be unaddressed? We’re still encountering it and would really appreciate any updates or suggestions. Thanks in advance!
We are having the same issue. Have you found any workarounds?
Has anyone figured out how to resolve this issue or at least has any idea what might be causing it? Could it be related to the library itself, or is it a core Mapbox GL issue (perhaps something with native events)?
This issue is quite important — it doesn't just freeze the map when clicking a feature multiple times, but also during drawing if the user's cursor leaves the map and interacts with something else. That action freezes the map as well.
Has anyone figured out how to resolve this issue or at least has any idea what might be causing it? Could it be related to the library itself, or is it a core Mapbox GL issue (perhaps something with native events)?
This issue is quite important — it doesn't just freeze the map when clicking a feature multiple times, but also during drawing if the user's cursor leaves the map and interacts with something else. That action freezes the map as well.
We found a workaround to this by manually enabling dragPan on the map object whenever the draw selection changes. Some pseudocode:
map.on("draw.selectionchange", () => {
map.dragPan.enable();
});
I have not looked into as to why it happens, but dragPan seems to become disabled whenever a feature is clicked too many times. This code make sure dragPan is always enabled whenever the user clicks something. Hope this helps.
@olofholmlund 's workaround fixed a likely similar problem when extending a LineString on iPhone and drag somehow gets disabled. Thanks!