Skip to content

Commit a79dea7

Browse files
committed
Fix bug when clearing entire selection [1852]
- When drawing lasso bar and scatter trace weren't showing their points as deselected.
1 parent 5125981 commit a79dea7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/plots/cartesian/select.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,12 @@ function selectOnClick(gd, numClicks, evt, xAxes, yAxes, outlines) {
387387
}
388388

389389
// Grand selection state update needs to be done once for the entire plot
390-
eventData = {points: allSelectionItems};
391-
updateSelectedState(gd, searchTraces, eventData);
390+
if(clearEntireSelection) {
391+
updateSelectedState(gd, searchTraces);
392+
} else {
393+
eventData = {points: allSelectionItems};
394+
updateSelectedState(gd, searchTraces, eventData);
395+
}
392396
}
393397

394398
function clickedPtsFor(searchInfo, hoverData) {
@@ -524,11 +528,7 @@ function isPointSelected(trace, point) {
524528
function updateSelectedState(gd, searchTraces, eventData) {
525529
var i, j, searchInfo, trace;
526530

527-
// TODO previously eventData without a point would still set a selection
528-
// and all points would appear as non-selected. Moving to another drag mode like
529-
// zoom would leave this state. Discuss if the new behavior is better.
530-
var selectionNonEmpty = eventData && eventData.points && eventData.points.length > 0;
531-
if(selectionNonEmpty) {
531+
if(eventData) {
532532
// var pts = eventData.points || []; TODO remove eventually
533533
var pts = eventData.points;
534534

0 commit comments

Comments
 (0)