Skip to content

Commit 508e316

Browse files
authored
Merge pull request #6281 from mmtmr/fix-mobile-mapbox-pan-event
Fixed Mapbox Touch Event on Mobile After Switching Back from Select Mode
2 parents 1169948 + ad57366 commit 508e316

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

draftlogs/6281_fix.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Fix mapbox `touch event` after switching back from select mode [[#6281](https://github.com/plotly/plotly.js/pull/6281)],
2+
with thanks to @mmtmr for the contribution!

src/plots/mapbox/mapbox.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,8 @@ proto.updateFx = function(fullLayout) {
600600
map.dragPan.enable();
601601
map.off('zoomstart', self.clearSelect);
602602
self.div.onmousedown = null;
603-
603+
self.div.ontouchstart = null;
604+
self.div.removeEventListener('touchstart', self.div._ontouchstart);
604605
// TODO: this does not support right-click. If we want to support it, we
605606
// would likely need to change mapbox to use dragElement instead of straight
606607
// mapbox event binding. Or perhaps better, make a simple wrapper with the

0 commit comments

Comments
 (0)