Skip to content

Commit 07f2b70

Browse files
committed
small tweak to always call handler
1 parent 6477e1a commit 07f2b70

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/components/legend/draw.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,11 +464,9 @@ function clickOrDoubleClick(gd, legend, legendItem, numClicks, evt) {
464464
if(Registry.traceIs(trace, 'pie-like')) {
465465
evtData.label = legendItem.datum()[0].label;
466466
}
467-
467+
var clickVal = Events.triggerHandler(gd, 'plotly_legendclick', evtData);
468468
if(numClicks === 1) {
469-
var clickVal = Events.triggerHandler(gd, 'plotly_legendclick', evtData);
470469
if(clickVal === false) return;
471-
472470
legend._clickTimeout = setTimeout(function() {
473471
if(!gd._fullLayout) return;
474472
handleClick(legendItem, gd, numClicks);

test/jasmine/tests/legend_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2720,7 +2720,7 @@ describe('legend with custom doubleClickDelay', function() {
27202720
.then(_assert('[long] after click + (t/2) delay', 1, 0))
27212721
.then(delay(tLong + 10))
27222722
.then(click(0)).then(delay(DBLCLICKDELAY + 1)).then(click(0))
2723-
.then(_assert('[long] after click + (DBLCLICKDELAY+1) delay + click', 1, 1))
2723+
.then(_assert('[long] after click + (DBLCLICKDELAY+1) delay + click', 2, 1))
27242724
.then(delay(tLong + 10))
27252725
.then(click(0)).then(delay(1.1 * tLong)).then(click(0))
27262726
.then(_assert('[long] after click + (1.1*t) delay + click', 2, 0))

0 commit comments

Comments
 (0)