]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Allow contextmenu (right click) events to trigger the onClick handler (#7828)
authorEvert Timberg <evert.timberg+github@gmail.com>
Thu, 1 Oct 2020 12:47:09 +0000 (08:47 -0400)
committerGitHub <noreply@github.com>
Thu, 1 Oct 2020 12:47:09 +0000 (08:47 -0400)
src/core/core.controller.js

index 5f0834b87f38389602702c84cf2c0b282672e47a..a4f4be60f7e17df257fbccb704942bcd9ad07da4 100644 (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);
                        }