Exit to browse mode if selected items gone, only in response to user drags

This commit is contained in:
Bryan Housel
2016-11-07 11:46:38 -05:00
parent 3224130821
commit 2562460962

View File

@@ -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 {