File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -420,6 +420,10 @@ proto.updateFx = function(fullLayout) {
420420 subplot : self . id
421421 } ) ;
422422
423+ // Unregister the old handler before potentially registering
424+ // a new one. Otherwise multiple click handlers might
425+ // be registered resulting in unwanted behavior.
426+ map . off ( 'click' , self . onClickInPanHandler ) ;
423427 if ( dragMode === 'select' || dragMode === 'lasso' ) {
424428 map . dragPan . disable ( ) ;
425429 map . on ( 'zoomstart' , self . clearSelect ) ;
@@ -430,8 +434,6 @@ proto.updateFx = function(fullLayout) {
430434 } ;
431435
432436 dragElement . init ( self . dragOptions ) ;
433-
434- map . off ( 'click' , self . onClickInPanHandler ) ;
435437 } else {
436438 map . dragPan . enable ( ) ;
437439 map . off ( 'zoomstart' , self . clearSelect ) ;
You can’t perform that action at this time.
0 commit comments