Skip to content

Pass the hover event to the onHover event handler - #3669

Merged
etimberg merged 2 commits into
chartjs:masterfrom
compwright:fix-hover-event
Dec 3, 2016
Merged

etimberg merged 2 commits into
chartjs:masterfrom
compwright:fix-hover-event

Conversation

@compwright

Copy link
Copy Markdown
Contributor

BREAKING CHANGE:

This makes the behavior of the onHover handler consistent with the onClick handler:

function(event, activeElements) {
    var chartInstance = this;
}

Previously, activeEvents was the first argument, and event was not passed.

This makes the behavior of the `onHover` handler consistent with the `onClick` handler:

```
function(event, activeElements) {
    var chartInstance = this;
}
```
@etimberg

etimberg commented Dec 3, 2016

Copy link
Copy Markdown
Member

I think this is fine to make this consistent. To prevent the breaking API change we could put the event as the last parameter. @simonbrunel thoughts?

@compwright

Copy link
Copy Markdown
Contributor Author

Personally, I think the breaking change is worth it for consistency's sake.

@simonbrunel

Copy link
Copy Markdown
Member

I prefer consistency as well

@etimberg etimberg added this to the Version 2.5 milestone Dec 3, 2016
@etimberg

etimberg commented Dec 3, 2016

Copy link
Copy Markdown
Member

Ok, sounds good. We'll need to keep this in mind when writing the release notes for v2.5

@etimberg
etimberg merged commit 152ce9c into chartjs:master Dec 3, 2016
exwm pushed a commit to exwm/Chart.js that referenced this pull request Apr 30, 2021
Pass the hover event to the onHover event handler

This makes the behavior of the `onHover` handler consistent with the `onClick` handler:

```
function(event, activeElements) {
    var chartInstance = this;
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants