mapbox / mapbox/mapbox-gl-draw

Keybindings don't work unless controls are shown

Open
#989 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #952 by @jorgedl — closed without merging
bug has PR
Dominant language
JavaScript
Stars
1.1k
Forks
612
Avg merge
8d 9h
Merged PRs (30d)
5

Description

**mapbox-gl-js version**: 1.9.0
**mapbox-gl-draw version**: 1.1.2

### Steps to Trigger Behavior

Initialise draw like:

draw = new MapboxDraw({
displayControlsDefault: false,
modes: {
...MapboxDraw.modes,
},
keybindings: true,
});

2. Create a line feature and select one vertex
3. Press the delete key

### Expected Behavior

Vertex is deleted

### Actual Behavior

Nothing. You need to have at least the Trash control displayed.

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 issue with MapboxDraw using displayControlsDefault: false, keybindings: true, a selected line vertex, and the Delete key. Trace how keyboard handling relates to the Trash control, then verify that the vertex is deleted without displaying that control.

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.