File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ var connectColorbar = require('../components/colorbar/connect');
3232var initInteractions = require('../plots/cartesian/graph_interact').initInteractions;
3333var xmlnsNamespaces = require('../constants/xmlns_namespaces');
3434var svgTextUtils = require('../lib/svg_text_utils');
35+ var clearSelect = require('../plots/cartesian/select').clearSelect;
3536
3637var dfltConfig = require('./plot_config').dfltConfig;
3738var manageArrays = require('./manage_arrays');
@@ -2001,7 +2002,13 @@ function addAxRangeSequence(seq, rangesAltered) {
20012002 return Axes.draw(gd, 'redraw');
20022003 };
20032004
2005+ var _clearSelect = function(gd) {
2006+ var zoomlayer = gd._fullLayout._zoomlayer;
2007+ if(zoomlayer) clearSelect(zoomlayer);
2008+ };
2009+
20042010 seq.push(
2011+ _clearSelect,
20052012 subroutines.doAutoRangeAndConstraints,
20062013 drawAxes,
20072014 subroutines.drawData,
Original file line number Diff line number Diff line change @@ -1226,6 +1226,28 @@ describe('Test select box and lasso in general:', function() {
12261226 .then(done);
12271227 });
12281228
1229+ it('@flaky should have their selection outlines cleared during *axrange* relayout calls', function(done) {
1230+ var gd = createGraphDiv();
1231+ var fig = Lib.extendDeep({}, mock);
1232+ fig.layout.dragmode = 'select';
1233+
1234+ function _drag() {
1235+ resetEvents(gd);
1236+ drag(selectPath);
1237+ return selectedPromise;
1238+ }
1239+
1240+ Plotly.plot(gd, fig)
1241+ .then(_drag)
1242+ .then(function() { assertSelectionNodes(0, 2, 'after drag 1'); })
1243+ .then(function() { return Plotly.relayout(gd, 'xaxis.range', [-5, 5]); })
1244+ .then(function() { assertSelectionNodes(0, 0, 'after axrange relayout'); })
1245+ .then(_drag)
1246+ .then(function() { assertSelectionNodes(0, 2, 'after drag 2'); })
1247+ .catch(failTest)
1248+ .then(done);
1249+ });
1250+
12291251 it('@flaky should select the right data with the corresponding select direction', function(done) {
12301252
12311253 var gd = createGraphDiv();
You can’t perform that action at this time.
0 commit comments