You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem happens because the lastActive array which is set here contains the active element which is removed in the onClick, so in the following mousemove event happening after the mouseup event fails because this line contains the removed element, and the call to updateHoverStyle() fails because the dataset is not present anymore.
Expected Behavior
It should be possible to remove a dataset within onClick() and move the mouse just after without any error.
Possible Solution
Update lastActive in the top of handleEvent so that it only includes elements which are still present on the chart.
I'm experiencing this as well. Here's a demo. To reproduce it, open your JavaScript console (not the one that comes with Codepen), then click on one of the bars. You'll see the second dataset disappear. If you then move your mouse, you'll see your console flooded with errors.
The problem happens because the
lastActive
array which is set here contains the active element which is removed in the onClick, so in the following mousemove event happening after the mouseup event fails because this line contains the removed element, and the call toupdateHoverStyle()
fails because the dataset is not present anymore.Expected Behavior
It should be possible to remove a dataset within onClick() and move the mouse just after without any error.
Possible Solution
Update
lastActive
in the top ofhandleEvent
so that it only includes elements which are still present on the chart.This hack is a temporary workaround:
The text was updated successfully, but these errors were encountered: