mapbox / mapbox/mapbox-gl-draw
The delete coordinate keybinding is broken if displayControlsDefault: false
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**: 0.47.0
**mapbox-gl-draw**: 1.0.9
var draw = new MapboxDraw({
displayControlsDefault: false,
keybindings: true,
});
draw.changeMode('draw_polygon');
#### Steps: ####
1) Draw a polygon with your mouse
2) Click one of the polygon's coordinates and select it
3) Hit delete on your keyboard.
#### Expected: ####
The coordinate deletes and the polygon changes shape.
#### Actual: ####
The coordinate only deletes if `displayControlsDefault: true`.
#### Demo: ####
Try switching `bugActive`:
https://jsbin.com/gidotifaxa/1/edit?html,output
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
Reproduce the behavior using the Mapbox GL Draw 1.0.9 configuration in the issue and the linked JSBin, with displayControlsDefault set to false and keybindings enabled. Start at the draw.changeMode('draw_polygon') entry point and trace how the delete key is registered and handled; done means deleting a selected coordinate changes the polygon in both control-display configurations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100