From 25624609622d5b847ea365235d65f048f0c4fa36 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 7 Nov 2016 11:46:38 -0500 Subject: [PATCH] Exit to browse mode if selected items gone, only in response to user drags --- modules/modes/select.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/modes/select.js b/modules/modes/select.js index 94eacaeec..658814d69 100644 --- a/modules/modes/select.js +++ b/modules/modes/select.js @@ -243,7 +243,10 @@ export function modeSelect(context, selectedIDs) { .selectAll(utilEntityOrMemberSelector(selectedIDs, context.graph())); if (selection.empty()) { - if (drawn) { // Exit mode if selected DOM elements have disappeared.. + // Return to browse mode if selected DOM elements have + // disappeared because the user moved them out of view.. + var source = d3.event && d3.event.type === 'zoom' && d3.event.sourceEvent; + if (drawn && source && (source.type === 'mousemove' || source.type === 'touchmove')) { context.enter(modeBrowse(context)); } } else {