Allow contextmenu (right click) events to trigger the onClick handler (#7828)

This commit is contained in:
Evert Timberg 2020-10-01 08:47:09 -04:00 committed by GitHub
parent 5c0d13981c
commit 08b69fd974
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1133,7 +1133,7 @@ class Chart {
// Invoke onHover hook
callCallback(options.onHover || options.hover.onHover, [e, active, me], me);
if (e.type === 'mouseup' || e.type === 'click') {
if (e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu') {
if (_isPointInArea(e, me.chartArea)) {
callCallback(options.onClick, [e, active, me], me);
}