You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a custom plugin that listens to mouseup events, and I want to be able to use the signal disabling feature of legend. Usually plugins take use of events property, but with typescript that is not possible, because it gives error that events property doesn't exist (see example).
Without typescript it is possible, but not using typescript is unfortunately not an option for me.
Current behavior
What happens now in the example, is that legend's onClick is run twice, therefore disabling and enabling the signal immediately. In the code it looks like mouseup and onClick are treated as the same event:
582:
function isListened(type, opts) {
if (opts.onClick && (type === 'click' || type === 'mouseup')) {
return true;
}
return false;
}
528:
handleEvent(e) {
if (!isListened(e.type, opts)) {
return;
}
if (e.type === 'mousemove' || e.type === 'mouseout') {
[...]
} else if (hoveredItem) {
call(opts.onClick, [e, hoveredItem, this], this);
}
}
Expected behavior
I have a custom plugin that listens to mouseup events, and I want to be able to use the signal disabling feature of legend. Usually plugins take use of events property, but with typescript that is not possible, because it gives error that events property doesn't exist (see example).
Without typescript it is possible, but not using typescript is unfortunately not an option for me.
Current behavior
What happens now in the example, is that legend's onClick is run twice, therefore disabling and enabling the signal immediately. In the code it looks like mouseup and onClick are treated as the same event:
582:
528:
Reproducible sample
https://stackblitz.com/edit/angular-chart-js-xkhcjv?file=src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp.component.html
Optional extra steps/info to reproduce
No response
Possible solution
No response
Context
No response
chart.js version
v4.3.0
Browser name and version
No response
Link to your project
No response
The text was updated successfully, but these errors were encountered: