From 7f2275bab90023f49f885a957eea1c1e58ba7d5e Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Wed, 3 May 2017 18:01:07 -0400 Subject: [PATCH] Shortcuts for point/line/area should deselect tool (closes #4003) --- modules/ui/modes.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/ui/modes.js b/modules/ui/modes.js index 7c70b09cc..fca3e07e9 100644 --- a/modules/ui/modes.js +++ b/modules/ui/modes.js @@ -82,9 +82,15 @@ export function uiModes(context) { var keybinding = d3keybinding('mode-buttons'); - modes.forEach(function(m) { - keybinding.on(m.key, function() { - if (editable()) context.enter(m); + modes.forEach(function(mode) { + keybinding.on(mode.key, function() { + if (editable()) { + if (mode.id === context.mode().id) { + context.enter(modeBrowse(context)); + } else { + context.enter(mode); + } + } }); });