mapbox / mapbox/mapbox-gl-draw

The delete coordinate keybinding is broken if displayControlsDefault: false

Open
#805 3 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug ui
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.