mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Limit onClick to chartArea (#6227)
* Limit onClick to chartArea * Utilize helpers.canvas._isPointInArea
This commit is contained in:
parent
1ac3a697f7
commit
db4a0d4569
@ -1080,7 +1080,7 @@ helpers.extend(Chart.prototype, /** @lends Chart */ {
|
||||
helpers.callback(options.onHover || options.hover.onHover, [e.native, me.active], me);
|
||||
|
||||
if (e.type === 'mouseup' || e.type === 'click') {
|
||||
if (options.onClick) {
|
||||
if (options.onClick && helpers.canvas._isPointInArea(e, me.chartArea)) {
|
||||
// Use e.native here for backwards compatibility
|
||||
options.onClick.call(me, e.native, me.active);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user