chartjs / chartjs/Chart.js

Fix Bug setting active hover to undefined

Open
#12,042 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
67.7k
Forks
11.9k
Avg merge
7h 39m
Merged PRs (30d)
5

Description

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used [patch-package](https://github.com/ds300/patch-package) to patch `chart.js@4.4.8` for the project I'm working on.

Here is the diff that solved my problem:

```diff
diff --git a/node_modules/chart.js/dist/chart.js b/node_modules/chart.js/dist/chart.js
index e67f0ee..6021286 100644
--- a/node_modules/chart.js/dist/chart.js
+++ b/node_modules/chart.js/dist/chart.js
@@ -1029,6 +1029,7 @@ class DatasetController {
}
}
_setStyle(element, index, mode, active) {
+ if (!element) return;
element.active = active;
const options = this.getStyle(index, active);
this._resolveAnimations(index, mode, active).update(element, {
```

This issue body was [partially generated by patch-package](https://github.com/ds300/patch-package/issues/296).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.