Skip to content

Commit 5a50ff0

Browse files
committed
fix issue 6259 - handle missing eventData, layout and selections
1 parent a159235 commit 5a50ff0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/selections/select.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,6 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
451451
dragOptions.doneFnCompleted(selection);
452452
}
453453

454-
eventData.selections = gd.layout.selections;
455454
emitSelected(gd, eventData);
456455
}).catch(Lib.error);
457456
};
@@ -530,7 +529,6 @@ function selectOnClick(evt, gd, xAxes, yAxes, subplot, dragOptions, polygonOutli
530529
}
531530

532531
if(sendEvents) {
533-
eventData.selections = gd.layout.selections;
534532
emitSelected(gd, eventData);
535533
}
536534
}
@@ -1195,7 +1193,6 @@ function reselect(gd, selectionTesters, searchTraces, dragOptions) {
11951193
fillRangeItems(eventData, poly);
11961194
}
11971195

1198-
eventData.selections = gd.layout.selections;
11991196
emitSelected(gd, eventData);
12001197
}
12011198

@@ -1216,7 +1213,6 @@ function reselect(gd, selectionTesters, searchTraces, dragOptions) {
12161213

12171214
if(sendEvents) {
12181215
if(eventData.points.length) {
1219-
eventData.selections = gd.layout.selections;
12201216
emitSelected(gd, eventData);
12211217
} else {
12221218
gd.emit('plotly_deselect', null);
@@ -1511,6 +1507,10 @@ function emitSelecting(gd, eventData) {
15111507
}
15121508

15131509
function emitSelected(gd, eventData) {
1510+
if(eventData) {
1511+
eventData.selections = (gd.layout || {}).selections || [];
1512+
}
1513+
15141514
gd.emit('plotly_selected', eventData);
15151515
}
15161516

0 commit comments

Comments
 (0)