mapbox / mapbox/mapbox-gl-js

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

Open
#10,179 3 comments 12 reactions 1 assignee View on GitHub

@ansis is already working on this.

Since Dec 10, 2020.

api :memo: bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

**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

```

mapboxgl.accessToken = 'token';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v11',
})
map.on('contextmenu', () => alert('contextmenu event works'))

```

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).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.