@@ -433,10 +433,6 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
433433 throttle . done ( throttleID ) . then ( function ( ) {
434434 throttle . clear ( throttleID ) ;
435435
436- // Only points selected by the new selection are presented in eventData here
437- // Should we provide all the selected points instead?
438- dragOptions . gd . emit ( 'plotly_selected' , eventData ) ;
439-
440436 if ( ! immediateSelect && currentPolygon && dragOptions . selectionDefs ) {
441437 // save last polygons
442438 currentPolygon . subtract = subtract ;
@@ -454,6 +450,9 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
454450 if ( dragOptions . doneFnCompleted ) {
455451 dragOptions . doneFnCompleted ( selection ) ;
456452 }
453+
454+ eventData . selections = gd . layout . selections ;
455+ dragOptions . gd . emit ( 'plotly_selected' , eventData ) ;
457456 } ) . catch ( Lib . error ) ;
458457 } ;
459458}
@@ -531,6 +530,7 @@ function selectOnClick(evt, gd, xAxes, yAxes, subplot, dragOptions, polygonOutli
531530 }
532531
533532 if ( sendEvents ) {
533+ eventData . selections = gd . layout . selections ;
534534 gd . emit ( 'plotly_selected' , eventData ) ;
535535 }
536536 }
@@ -1195,6 +1195,7 @@ function reselect(gd, selectionTesters, searchTraces, dragOptions) {
11951195 fillRangeItems ( eventData , poly ) ;
11961196 }
11971197
1198+ eventData . selections = gd . layout . selections ;
11981199 gd . emit ( 'plotly_selected' , eventData ) ;
11991200 }
12001201
@@ -1215,6 +1216,7 @@ function reselect(gd, selectionTesters, searchTraces, dragOptions) {
12151216
12161217 if ( sendEvents ) {
12171218 if ( eventData . points . length ) {
1219+ eventData . selections = gd . layout . selections ;
12181220 gd . emit ( 'plotly_selected' , eventData ) ;
12191221 } else {
12201222 gd . emit ( 'plotly_deselect' , null ) ;
0 commit comments