From d0fcae1b15d81f7f7baa6ae1bc40118b68c8639a Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 7 Aug 2017 00:23:53 -0400 Subject: [PATCH] When drawing, ignore accidental clicks on mode buttons (closes #4042) --- modules/ui/modes.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/ui/modes.js b/modules/ui/modes.js index fca3e07e9f..ab4bdb024c 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);