Skip to content

Commit

Permalink
When drawing, ignore accidental clicks on mode buttons
Browse files Browse the repository at this point in the history
(closes #4042)
  • Loading branch information
bhousel committed Aug 7, 2017
1 parent 8de3429 commit d0fcae1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/ui/modes.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ export function uiModes(context) {
.attr('tabindex', -1)
.attr('class', function(mode) { return mode.id + ' add-button col4'; })
.on('click.mode-buttons', function(mode) {
if (mode.id === context.mode().id) {
// When drawing, ignore accidental clicks on mode buttons - #4042
var currMode = context.mode().id;
if (currMode.match(/^draw/) !== null) return;

if (mode.id === currMode) {
context.enter(modeBrowse(context));
} else {
context.enter(mode);
Expand Down

0 comments on commit d0fcae1

Please sign in to comment.