Skip to content

Commit 9c9a8c8

Browse files
committed
move override fillRangeItems outside prepSelect
1 parent 6c1f418 commit 9c9a8c8

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/components/selections/select.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,7 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
141141
var searchTraces = determineSearchTraces(gd, dragOptions.xaxes,
142142
dragOptions.yaxes, dragOptions.subplot);
143143

144-
// allow subplots (i.e. geo, mapbox, sankey) to override fillRangeItems routine
145-
var fillRangeItems = plotinfo.fillRangeItems ||
146-
makeFillRangeItems(dragOptions.xaxes.concat(dragOptions.yaxes));
144+
var fillRangeItems = getFillRangeItems(dragOptions);
147145

148146
dragOptions.moveFn = function(dx0, dy0) {
149147
x1 = Math.max(0, Math.min(pw, scaleX * dx0 + x0));
@@ -1307,6 +1305,16 @@ function makeFillRangeItems(allAxes) {
13071305
};
13081306
}
13091307

1308+
function getFillRangeItems(dragOptions) {
1309+
var plotinfo = dragOptions.plotinfo;
1310+
1311+
return (
1312+
plotinfo.fillRangeItems || // allow subplots (i.e. geo, mapbox, sankey) to override fillRangeItems routine
1313+
makeFillRangeItems(dragOptions.xaxes.concat(dragOptions.yaxes))
1314+
);
1315+
}
1316+
1317+
13101318
module.exports = {
13111319
reselect: reselect,
13121320
prepSelect: prepSelect,

0 commit comments

Comments
 (0)