Skip to content

Conversation

@etpinard
Copy link
Contributor

fixes #2819, an edge case that made

clickFn: function(numClicks, e) {
var clickedTrace = fullLayout._infolayer.selectAll('g.traces').filter(function() {
var bbox = this.getBoundingClientRect();
return (
e.clientX >= bbox.left && e.clientX <= bbox.right &&
e.clientY >= bbox.top && e.clientY <= bbox.bottom
);
});
if(clickedTrace.size() > 0) {
clickOrDoubleClick(gd, legend, clickedTrace, numClicks, e);
}
}

not grab the correct legend item bounding boxes when edits.legendPosition was turned on.

cc @alexcjohnson

etpinard added 2 commits July 19, 2018 17:13
- just like we do currently for edits.legendText,
  that way the legend dragElement instance can correctly retrieve
  the legend item bounding box
@etpinard etpinard added bug something broken status: reviewable labels Jul 19, 2018
@alexcjohnson
Copy link
Collaborator

Beautiful. Thanks for sorting out that flakiness. 💃

@etpinard etpinard merged commit 180b6b9 into master Jul 23, 2018
@etpinard etpinard deleted the legend-horiz-edit-position-fixups branch July 23, 2018 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug something broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only first trace toggled when horizontal legend and legendPosition: true

3 participants