Skip to content

Commit

Permalink
allow browser context menu when possible (#7369)
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner authored Oct 5, 2018
1 parent dc53cd3 commit 287e330
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ui/bind_handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,11 @@ export default function bindHandlers(map: Map, options: {interactive: boolean, c
contextMenuEvent = e;
}

e.preventDefault();
// prevent browser context menu when necessary; we don't allow it with rotation
// because we can't discern rotation gesture start from contextmenu on Mac
if (map.dragRotate.isEnabled() || map.listens('contextmenu')) {
e.preventDefault();
}
}

function onWheel(e: WheelEvent) {
Expand Down

0 comments on commit 287e330

Please sign in to comment.