On Mobile (Chrome): "dblclick" event not emited on 2x clicks, only on 3x clicks. "click" event only emitted once on double click.
@avpeery is already working on this.
Since Oct 14, 2021.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.