mapbox / mapbox-gl-js

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
https://docs.mapbox.com/mapbox-gl-js/
Other
10.9k stars 2.19k forks source link

ContextMenu event is not triggered anymore on a long press on mobile since v1.10 #10179

Open paulgreg opened 3 years ago

paulgreg commented 3 years ago

mapbox-gl-js version: 1.10 and later

browser: Android Chrome 87

Steps to Trigger Behavior

  1. declare a contextmenu event on a map
  2. do a long touch on a mobile device
  3. contenumenu event is not trigerred anymore since mapbox version 1.10 (it works on v1.9)

Link to Demonstration

<div id='map' style='width: 400px; height: 300px;'></div>
<script>
mapboxgl.accessToken = 'token';
var map = new mapboxgl.Map({
    container: 'map',
    style: 'mapbox://styles/mapbox/streets-v11',
})
map.on('contextmenu', () => alert('contextmenu event works'))
</script>

With mapbox in version 1.9, an alert will be shown if you « long touch » the map on a mobile device. However, since v1.10 (and until 2.0), the alert won’t be displayed on a long touch on a mobile device.

Expected Behavior

ContextMenu event is trigerred on a mobile device on a long press.

Actual Behavior

ContextMenu event is not trigerred on a mobile device on a long press (it works on version 1.9).

douglasg14b commented 3 years ago

So, since this doesn't seem to support long presses, what now?

Pretty disappointing that even in v2, given the change in licensing & pricing, there isn't support for long presses. I'd expect higher quality when costing more money and becoming less OSS. Imagine if right-click events stopped firing in your favorite game engine, and they just let that bug stew for 6+ months...