mapbox / mapbox/mapbox-gl-js

On Mobile (Chrome): "dblclick" event not emited on 2x clicks, only on 3x clicks. "click" event only emitted once on double click.

Open
#10,511 2 comments 2 reactions 1 assignee View on GitHub

@avpeery is already working on this.

Since Oct 14, 2021.

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

**browser**: Chrome

### Steps to Trigger Behavior

Ensure you are on mobile, or in chrome device mode.

1. Setup event handlers for `dblclick` and `click`
2. Double Click
3. Observe `1` `click` event, and a map zoom, but no `dblclick`
4. Triple Click.
5. Observe 2x `click` , map zoom, and 1x `dblclick`

### Link to Demonstration

Use Chrome devtools and go into "Device Mode".

Note: `dblclick` doesn't emit at ALL in this example when in mobile mode. On my phone it emits only after 3x taps.

https://codepen.io/douglasg14b/pen/qBRbyRW

### Expected Behavior

Double-tapping (Or clicking in Device Mode on desktop) emits 2x `click` and 1x `dblclick`

### Actual Behavior

It emits 1x `click` and zero `dblclick`

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.