diff --git a/modules/ui/modes.js b/modules/ui/modes.js index fca3e07e9..ab4bdb024 100644 --- a/modules/ui/modes.js +++ b/modules/ui/modes.js @@ -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);