mapbox / mapbox-gl-draw

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

Clicking draw button toggles active class, doesn't cancel drawing mode #698

Closed andycochran closed 4 years ago

andycochran commented 6 years ago

The .active class on the draw buttons can't be used to indicate to the user that they are in drawing mode — e.g. by changing the color of the button — because clicking the draw button a second time does not cancel drawing mode.

Steps to Trigger Behavior

  1. Go to mapbox.com/mapbox-gl-js/example/mapbox-gl-draw
  2. Inspect the .mapbox-gl-draw_polygon button
  3. Click the polygon button (note in the inspector that the button gets an .active class)
  4. Click the polygon button again (note the .active class is removed)
  5. Draw a polygon on the map

Expected Behavior

If clicking the draw button toggles its .active class, the draw mode should also be toggled. The active class should be used to indicate to the user that they are in drawing mode.

Actual Behavior

Clicking the draw button toggles its .active class but does not toggle drawing mode. So the active class can't be used to indicate drawing mode.

mapbox-gl-js version: 0.40.1 mapbox-gl-draw version: 1.0.2

jesusr commented 6 years ago

+1 This is the behavior I am looking for.

CrokinoleMaster commented 4 years ago

Any reason why my PR isn't being looked at or accepted?

kkaefer commented 4 years ago

PR got merged. Thanks for your contribution!