mapbox / mapbox/mapbox-gl-draw
Adding MapboxDraw breaks 'click' event on mobile
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 612
- Avg merge
- 8d 9h
- Merged PRs (30d)
- 5
Description
**mapbox-gl-js version**: 1.13.0
**mapbox-gl-draw version**: 1.4.3
### Steps to Trigger Behavior
1. Open in mobile browser (or in web browser and change user agent to mobile using developer tools)
2. Click on map
### Expected Behavior
Click event should register.
### Actual Behavior
Click event doesn't register. When double clicking, then a single 'click' event registers.
```
body { margin: 0; padding: 0; }
#map { position: absolute; top: 0; bottom: 0; width: 100%; }
const map = new mapboxgl.Map({
container: 'map',
style: 'enter-your-style'
});
map.addControl(new MapboxDraw(), 'top-left');
map.on('click', () => {
alert('click');
console.log('click');
});
```
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.
Research direction
Start with the minimal HTML reproduction using mapbox-gl-js 1.13.0, mapbox-gl-draw 1.4.3, map.addControl(new MapboxDraw()), and map.on('click'). Reproduce the behavior on a mobile user agent, then trace the click handling around the Draw control; done means a single click event registers normally on mobile.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100