mapbox / mapbox/mapbox-gl-draw
Calling getSelectedPoints in draw.update handler causes a crash
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 612
- Avg merge
- 8d 9h
- Merged PRs (30d)
- 5
Description
I've forked the default demo sandbox here: https://codesandbox.io/p/sandbox/wp488f
Preview link here: https://mr93f6.csb.app/
All I've done is added `console.log(draw.getSelectedPoints());` to the `updateArea` function.
## Steps to reproduce:
1. Draw a polygon
2. Select a point
3. Trash the point, page crashes
Note that it doesn't always crash, so keep trying. It'll happen eventually.
### Screenshot of sandbox page crash
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 CodeSandbox and the updateArea handler, where draw.getSelectedPoints() was added. Reproduce the crash by drawing a polygon, selecting a point, and trashing it, repeating as needed because the failure is intermittent. Done means the handler no longer crashes during this sequence and the selected-points behavior remains usable.
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