]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Add missing mouse events to CoreChartOptions.events type (#10124)
authorJérémy Morel <morel.jeremy@gmail.com>
Wed, 9 Feb 2022 12:45:30 +0000 (13:45 +0100)
committerGitHub <noreply@github.com>
Wed, 9 Feb 2022 12:45:30 +0000 (07:45 -0500)
* add missing mouse events to CoreChartOptions.events type

* allow all html event names in CoreChartOptions.events

types/index.esm.d.ts

index 21e6b839e00a220fd03e7b5a2686f6326aacb2ed..ccea4128037a204f798b600a4672bf4b9ed26d20 100644 (file)
@@ -1493,20 +1493,7 @@ export interface CoreChartOptions<TType extends ChartType> extends ParsingOption
    * The events option defines the browser events that the chart should listen to for tooltips and hovering.
    * @default ['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove']
    */
-  events: (
-    'mousemove' |
-    'mouseout' |
-    'click' |
-    'touchstart' |
-    'touchmove' |
-    'touchend' |
-    'pointerenter' |
-    'pointerdown' |
-    'pointermove' |
-    'pointerup' |
-    'pointerleave' |
-    'pointerout'
-  )[];
+  events: (keyof HTMLElementEventMap)[]
 
   /**
    * Called when any of the events fire. Passed the event, an array of active elements (bars, points, etc), and the chart.