Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ffe1700

Browse filesBrowse files
committed
make sure scroll clears selection outline not just the 1st time
1 parent 7784a10 commit ffe1700
Copy full SHA for ffe1700

File tree

Expand file treeCollapse file tree

2 files changed

+15
-6
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+15
-6
lines changed

‎src/plots/cartesian/dragbox.js

Copy file name to clipboardExpand all lines: src/plots/cartesian/dragbox.js
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,7 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
393393
return;
394394
}
395395

396-
if(redrawTimer === null) {
397-
clearSelect(zoomlayer);
398-
}
396+
clearSelect(zoomlayer);
399397

400398
// If a transition is in progress, then disable any behavior:
401399
if(gd._transitioningWithDuration) {

‎test/jasmine/tests/select_test.js

Copy file name to clipboardExpand all lines: test/jasmine/tests/select_test.js
+14-3Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,16 +539,27 @@ describe('@flaky Test select box and lasso in general:', function() {
539539
mockCopy.layout.dragmode = 'select';
540540
mockCopy.config = {scrollZoom: true};
541541

542-
Plotly.plot(gd, mockCopy).then(function() {
542+
function _drag() {
543543
resetEvents(gd);
544544
drag(selectPath);
545545
return selectedPromise;
546-
})
547-
.then(function() {
546+
}
547+
548+
function _scroll() {
548549
mouseEvent('mousemove', selectPath[0][0], selectPath[0][1]);
549550
mouseEvent('scroll', selectPath[0][0], selectPath[0][1], {deltaX: 0, deltaY: -20});
551+
}
552+
553+
Plotly.plot(gd, mockCopy)
554+
.then(_drag)
555+
.then(_scroll)
556+
.then(function() {
557+
assertSelectionNodes(0, 0);
550558
})
559+
.then(_drag)
560+
.then(_scroll)
551561
.then(function() {
562+
// make sure it works the 2nd time aroung
552563
assertSelectionNodes(0, 0);
553564
})
554565
.catch(failTest)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.