diff --git a/draftlogs/6870_change.md b/draftlogs/6870_change.md new file mode 100644 index 00000000000..a4764eb9b66 --- /dev/null +++ b/draftlogs/6870_change.md @@ -0,0 +1 @@ +- Fix bug where extending an existing box/lasso selection on traces with overlaying axes didn't update the selection [[#6870](https://github.com/plotly/plotly.js/pull/6870)]. \ No newline at end of file diff --git a/src/components/selections/select.js b/src/components/selections/select.js index b0d76a1b24f..df6a80c70a8 100644 --- a/src/components/selections/select.js +++ b/src/components/selections/select.js @@ -809,8 +809,8 @@ function determineSearchTraces(gd, xAxes, yAxes, subplot) { var sankeyInfo = createSearchInfo(trace._module, cd, xAxes[0], yAxes[0]); searchTraces.push(sankeyInfo); } else { - if(xAxisIds.indexOf(trace.xaxis) === -1) continue; - if(yAxisIds.indexOf(trace.yaxis) === -1) continue; + if(xAxisIds.indexOf(trace.xaxis) === -1 && (!trace._xA || !trace._xA.overlaying)) continue; + if(yAxisIds.indexOf(trace.yaxis) === -1 && (!trace._yA || !trace._yA.overlaying)) continue; searchTraces.push(createSearchInfo(trace._module, cd, getFromId(gd, trace.xaxis), getFromId(gd, trace.yaxis)));