Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fixed Mapbox Touch Event on Mobile After Switching Back from Select Mode #6281

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

Merged
merged 3 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions draftlogs/6281_fix.md
Original file line number Diff line number Diff line change
@@ -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!
3 changes: 2 additions & 1 deletion src/plots/mapbox/mapbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down