From ff14dbf944e8f431cba7765187648a176b875b09 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Fri, 12 May 2017 14:39:41 +0100 Subject: [PATCH] Allow contextmenu events to work on the sidebar (closes #4036) --- modules/behavior/select.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/behavior/select.js b/modules/behavior/select.js index db07f7468..fdaea2585 100644 --- a/modules/behavior/select.js +++ b/modules/behavior/select.js @@ -164,8 +164,11 @@ export function behaviorSelect(context) { // Edge and IE really like to show the contextmenu on the // menubar when user presses a keyboard menu button // even after we've already preventdefaulted the key event. - d3.event.preventDefault(); - d3.event.stopPropagation(); + var e = d3.event; + if (+e.clientX === 0 && +e.clientY === 0) { + d3.event.preventDefault(); + d3.event.stopPropagation(); + } }); selection