diff --git a/draftlogs/6281_fix.md b/draftlogs/6281_fix.md new file mode 100644 index 00000000000..f3f844e639c --- /dev/null +++ b/draftlogs/6281_fix.md @@ -0,0 +1,2 @@ + - Fix mapbox `touch event` after switching back from select mode [[#6281](https://github.com/plotly/plotly.js/pull/6281)], + with thanks to @mmtmr for the contribution! diff --git a/src/plots/mapbox/mapbox.js b/src/plots/mapbox/mapbox.js index a4a42a9ab41..ed021940862 100644 --- a/src/plots/mapbox/mapbox.js +++ b/src/plots/mapbox/mapbox.js @@ -600,7 +600,8 @@ proto.updateFx = function(fullLayout) { map.dragPan.enable(); map.off('zoomstart', self.clearSelect); self.div.onmousedown = null; - + self.div.ontouchstart = null; + self.div.removeEventListener('touchstart', self.div._ontouchstart); // TODO: this does not support right-click. If we want to support it, we // would likely need to change mapbox to use dragElement instead of straight // mapbox event binding. Or perhaps better, make a simple wrapper with the