You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Releasing one finger in pinch to zoom makes map to jump #9136
Map will move as pointer reference is changed and uses delta as movement.
Link to Demonstration
Here is a demo with visuals of the pointers added and how the change from the second to be the first (and only active) makes the map to move aggressively as it the user would have dragged it around
Expected Behavior
Releasing one finger should not have a effect on the map
Actual Behavior
It takes the finger release as a drag action
Workaround
This hack reduces the amount the times the issue is triggered
import{Map}from"mapbox-gl";constpointers=newSet();constmapboxElement=document.getElementById("#container");constmapboxInstance=newMap({container: mapboxElement});// Add active pointersmapboxElement.addEventListener("pointerdown",({ pointerType, pointerId })=>{if(pointerType==="touch"){pointers.add(pointerId);}},{capture: true});// Remove and stop actions on releasemapboxElement.addEventListener("pointerup",event=>{const{ pointerId, pointerType }=event;const[firstPointer]=Array.from(pointers);if(pointerType!=="touch")return;if(pointers.size===2&&firstPointer===pointerId){event.preventDefault();mapboxInstance.dragPan.disable();}elseif(pointers.size===1){mapboxInstance.dragPan.enable();}pointers.delete(pointerId);},{capture: true});
Reacted by Leem, Nicolás M. Pardo, Adrien Matissart, JeongMinseok, Alex and Thibaud Michel
Thanks for your attention. This surprising bug has been plaguing our site for some time now making the map unusable with touch. I do not imagine many people actually consistently release both fingers at the same exact time when pinch zooming. This bug is causing many or most people using touch to experience head-spinning unexpected high speed trips to a new destination and loss of their intended map position.
Hi @Nikodermus@mapcarta - thanks for using Mapbox & for reporting this! We are aware of this bug and are working on fixing it as part of a larger overhaul of gesture handling, including touch gestures. Stay tuned!
I would like to please check up on the progress of the fix of this very critical bug. I'm surprised that this isn't being urgently worked on, as this is a severe product breaking error. The majority of devices use touch. Every one of these now experience a disaster when pinching except when both fingers are released at exactly the same time.
I agree that this is a duplicate of #8889, however the issue is better identified here.
This has been fixed by #9365. If you have a chance to test and confirm, that would be great! The fix is in master and will be released in a beta release tomorrow.
Activity
mapcarta commentedon Jan 8, 2020
Thanks for your attention. This surprising bug has been plaguing our site for some time now making the map unusable with touch. I do not imagine many people actually consistently release both fingers at the same exact time when pinch zooming. This bug is causing many or most people using touch to experience head-spinning unexpected high speed trips to a new destination and loss of their intended map position.
vakila commentedon Jan 8, 2020
Hi @Nikodermus @mapcarta - thanks for using Mapbox & for reporting this! We are aware of this bug and are working on fixing it as part of a larger overhaul of gesture handling, including touch gestures. Stay tuned!
Related/possible duplicate: #8889
mapcarta commentedon Feb 16, 2020
I would like to please check up on the progress of the fix of this very critical bug. I'm surprised that this isn't being urgently worked on, as this is a severe product breaking error. The majority of devices use touch. Every one of these now experience a disaster when pinching except when both fingers are released at exactly the same time.
I agree that this is a duplicate of #8889, however the issue is better identified here.
awulkan commentedon Mar 2, 2020
@vakila Hey, is there anywhere I can check the progress of this gesture handling overhaul?
asheemmamoowala commentedon Mar 2, 2020
@awulkan @mapcarta This is moving ahead in #9365.
ansis commentedon Apr 7, 2020
This has been fixed by #9365. If you have a chance to test and confirm, that would be great! The fix is in
masterand will be released in a beta release tomorrow.