Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix non-passive event listener warning in Chrome #4424

Merged
merged 1 commit into from Jun 25, 2017

Conversation

simonbrunel
Copy link
Member

Deprecate addEvent and removeEvent, and move implementation in platform.dom.js. Add 'options' feature detection to register event listeners as passive and prevent warning in Chrome.

Replaces #4356
Fixes #4287

@simonbrunel simonbrunel added this to the Version 2.7 milestone Jun 25, 2017
@simonbrunel simonbrunel mentioned this pull request Jun 25, 2017
}());

function addEventListener(node, type, listener) {
if (node.addEventListener) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@etimberg addEventListener and removeEventListener seems supported by IE9+ and all other browsers. What do you think to simplify these methods and remove attach/detachEvent + ['on' + type] =?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can do that. Our official support is IE >=11

}());

function addEventListener(node, type, listener) {
if (node.addEventListener) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can do that. Our official support is IE >=11

Deprecate `addEvent` and `removeEvent`, and move implementation in `platform.dom.js`. Add 'options' feature detection to register event listeners as passive and prevent warning in Chrome.
@simonbrunel
Copy link
Member Author

Updated: removed old ways to add/remove events.

@etimberg
Copy link
Member

Looks good to me

@etimberg etimberg merged commit 548edc6 into chartjs:master Jun 25, 2017
@simonbrunel simonbrunel deleted the helpers-events branch July 28, 2017 18:47
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.

None yet

2 participants