mapbox / mapbox-gl-draw

Draw tools for mapbox-gl-js
https://www.mapbox.com/mapbox-gl-js/example/mapbox-gl-draw/
ISC License
953 stars 593 forks source link

Keybindings don't work unless controls are shown #989

Open stevage opened 4 years ago

stevage commented 4 years ago

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,
});
  1. Create a line feature and select one vertex
  2. Press the delete key

Expected Behavior

Vertex is deleted

Actual Behavior

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

usb248 commented 4 years ago

https://github.com/mapbox/mapbox-gl-draw/pull/952/files