@@ -52,7 +52,8 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
5252 pw = xa [ 0 ] . _length ,
5353 ph = ya [ 0 ] . _length ,
5454 MINDRAG = constants . MINDRAG ,
55- MINZOOM = constants . MINZOOM ;
55+ MINZOOM = constants . MINZOOM ,
56+ isMainDrag = ( ns + ew === 'nsew' ) ;
5657
5758 for ( var i = 1 ; i < subplots . length ; i ++ ) {
5859 var subplotXa = subplots [ i ] . x ( ) ,
@@ -89,7 +90,7 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
8990 // and stop there
9091 if ( ! yActive && ! xActive ) {
9192 dragger . onmousedown = null ;
92- dragger . style . pointerEvents = ( ns + ew === 'nsew' ) ? 'all' : 'none' ;
93+ dragger . style . pointerEvents = isMainDrag ? 'all' : 'none' ;
9394 return dragger ;
9495 }
9596
@@ -107,7 +108,8 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
107108 doubleclick : doubleClick ,
108109 prepFn : function ( e , startX , startY ) {
109110 var dragModeNow = gd . _fullLayout . dragmode ;
110- if ( ns + ew === 'nsew' ) {
111+
112+ if ( isMainDrag ) {
111113 // main dragger handles all drag modes, and changes
112114 // to pan (or to zoom if it already is pan) on shift
113115 if ( e . shiftKey ) {
0 commit comments