diff --git a/modules/behavior/copy.js b/modules/behavior/copy.js index 34e5ac88f..73fe16b5e 100644 --- a/modules/behavior/copy.js +++ b/modules/behavior/copy.js @@ -48,7 +48,7 @@ export function behaviorCopy(context) { function doCopy() { - d3_event.preventDefault(); + if (!getSelectionText()) d3_event.preventDefault(); var graph = context.graph(), selected = groupEntities(context.selectedIDs(), graph), @@ -87,6 +87,9 @@ export function behaviorCopy(context) { return copy; } + function getSelectionText() { + return window.getSelection().toString(); + } copy.off = function() { d3_select(document).call(keybinding.off);