Consider stopPropagation on Marker click when draggable is true
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
mapbox-gl-js version: 1.9.1
browser: any
playground at https://jsfiddle.net/g39b5n2c/
When a Marker is draggable, dragging the Marker by a few pixels or by zero pixels causes a map click event to fire (map click doesn't fire when dragging the marker by a larger distance).
While for static markers without any interaction, I think it's a reasonable default to let the click flow down to the map and let the developer choose to stop this when they like with
marker.getElement().addEventListener('click', function (e) {
e.stopPropagation();
})
The question is when draggable is set, should we automatically stopPropagation on click to avoid a small drag also triggering a map click event, or should we leave as is and leave this to the developer?
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 linked JSFiddle playground and the Marker dragging and click behavior described in the issue. Determine whether draggable markers should stop propagation for clicks after small or zero-distance drags, then confirm the chosen behavior with an appropriate regression check; done means the behavior is intentional and documented by passing coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- 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