Skip to content

Fix Bug setting active hover to undefined #12042

Closed

Description

@gleb-28

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

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.

Activity

  1. LeeLenaleee commented on Mar 11, 2025

    @LeeLenaleee
    Collaborator

    Do you also have a reproducible sample of this failing and crashing?

  2. gleb-28 commented on Mar 18, 2025

    @gleb-28
    Author

    Hi! Thank you for your response. The issue seems to occur occasionally, likely when the chart is being destroyed while the mouse is still hovering over it. Unfortunately, I haven't been able to reproduce it consistently, which makes it challenging to provide a sample.

  3. HZ-labs commented on Jul 9, 2026

    @HZ-labs

    hello, I encountered this issue to

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions